This is my first Applescript, and has been working for 2 days when run from thr Applescript editor. Today, I started the Script Menu and put my script into the folder.
When I ran it from there, nothing happened. When I ran it from the editor, I got the error "Variable hdg is not defined" on the line with the <---.
When I ran it from there, nothing happened. When I ran it from the editor, I got the error "Variable hdg is not defined" on the line with the <---.
Code:
on enabledGUIScripting(true)
tell application "System Events"
activate -- brings System Events authentication dialog to front
set UI elements enabled to true
return UI elements enabled
end tell
end enabledGUIScripting
tell application "RUMlog"
set hdg to TxRprt
set beam to hdg as string <---- error here
repeat while length of beam as string < 3
set beam to "0" & beam
--display dialog "Now beam = " & beam buttons {"OK"}
end repeat
activate application "RotorDCU"
tell application "System Events"
tell process "RotorDCU"
set value of text field 1 of window "RotorDCU" to beam
end tell
end tell
end tell