SecuritySpy: PTZ to preset1 then return to last Macro (v9.0.3)

Hello all;

So for my first post here; (now second as I was asked to share the macro)... I am wondering how to pass a KM variable into an apple script. I am trying to get my camera to pan to my front door for a quick peek then return to its previous position. The script works fine if i use static values, but not dynamic. I have tried
$KMVAR_LastPTZ as well as %LastPTZ% , neither work. The following script at least plays out, but it doesn't return to its last position.

Here's the code.

    tell application "Keyboard Maestro Engine"
	set LastPos to getvariable "LastPTZ"
end tell

tell application "SecuritySpy"
	ptz preset1 camera number 2 speed 100
	delay 10
	ptz LastPos camera number 2 speed 100
end tell

SecuritySpy: PTZ to preset1 then return to last.kmmacros (7.2 KB)

SecuritySpy%3A%20PTZ%20to%20preset1%20then%20return%20to%20last

A post was merged into an existing topic: Pass Variable to Apple script