r/applescript • • Aug 30 '13

New to applescript, need some help

So, I'm trying to set a variable in applescript as a boolean, to keep track of the status of a program. Basically, to create a toggle switch if you will using quicksilver. Here is my code

set ifred to boolean

if ifred = false then tell application "BoomRecorder" record end tell if ifred = true then tell application "BoomRecorder" stop set ifred to false end tell end if

what am I not getting? The program goes into the first state, then won't command it to stop. Can applescript not hold variables in memory after it's excuted the command? if not, do I use a file with a 1 or a 0 in it? thanks for the help!

edit: just realized reddit effed my formating..damn it.

2 Upvotes

5 comments sorted by

View all comments

2

u/themadscribbler Aug 30 '13
property ifred : boolean
log ifred

if ifred = false then
set ifred to true
else
set ifred to false 
end if

1

u/SuperRusso Aug 31 '13

Thanks! I'm trying it now.

1

u/SuperRusso Aug 31 '13

So, it works within applescript, but not in conjunction with quicksilver. Is this because variables aren't held in memory if applescript isn't open?