I am trying to use a simple applescript with Spark to activate my browser and select the address field. The script is as follows:
tell application "System Events" to set FoxRunning to (name of processes) contains "firefox-bin"
if FoxRunning is true then
tell application "Firefox" to activate
tell application "System Events" to keystroke "l" using command down
else
tell application "Firefox" to launch
tell application "Firefox" to activate
end if
For some reason, only when using Spark, this script does not work right. Specifically, the line where I call system events to do the keystroke does not interact well with spark. It works absolutely fine from the script editor, but when I try to invoke it using Spark, it only works the first time. After that, I get the following symptons: It takes two presses of the keystroke to get it to go through, and it only activates FireFox, and does not select the address field. I have to restart the Spark Daemon to get it to work properly, and then again, it will work only once. As far as I can tell, this is specific to spark, and not an applescript issue. Anyone have any ideas?


