Hi,
I have two Applescripts doing the same thing but when I try to save the second Applescript as a Variable to KM Applescript returns an error message. The First script works perfectly.
First Script:
tell application "Daylite"
eval "(selectedObjects lastObject) name."
end tell
tell application "Keyboard Maestro Engine"
make variable with properties {name:"Client Name", value:result}
delay 0.05
end tell
First Script Result
tell application "Daylite"
eval "(selectedObjects lastObject) name."
--> "Adrian Lee"
end tell
tell application "Keyboard Maestro Engine"
make with properties {name:"Client Name", value:"Adrian Lee"} new variable
--> variable "Client Name"
end tell
Second Script
activate application "Daylite"
tell application "System Events"
tell process "Daylite"
get value of text area 1 of UI element 1 of UI element 2 of UI element 1 of UI element 3 of UI element 1 of scroll area 2 of splitter group 2 of splitter group 1 of group 1 of window 1
delay 0.05
end tell
end tell
tell application "Keyboard Maestro Engine"
make variable with properties {name:"Client Mobile Number", value:result}
delay 0.05
end tell
Second Script Result: The Error Message:
tell application "Daylite"
activate
end tell
tell application "System Events" to ¬
get value of text area 1 of UI element 1 of UI element 2 of UI element 1 of UI element 3 of UI element 1 of scroll area 2 of splitter group 2 of splitter group 1 of group 1 of window 1 of process "Daylite"
--> "(976) 444-4444 x234"
Result:
error "The variable result is not defined." number -2753 from result
Can anybody assist me? I can’t seem to identify where this has gone wrong or what i need to do to overcome this issue. Both scripts work until i try to make the second one a KM variable
Thank you