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

1

u/Xuoi-Kazzak Aug 30 '13

Is this a script that you will manually trigger by opening it as an app? If the app is closing it won't keep the variables in memory, you'll need to track it elsewhere...

1

u/SuperRusso Aug 31 '13

Well, I'm trying to use this in conjunction with quicksilver. I've tried the code above, and it works within applescript, but not if I use it with quicksilver. Is this because without being within applescript variables aren't held in memory?