View Full Version : Definig variable "when"

Sep 26, 2006, 01:05 AM
how do i do that? i want to (for e.g.) make a script so when i open safari it opens the dashboar so i can see what download speed i have, but whenever i try to put that in a scrit its says: vairable "when" is not defined
how do i define it!!
thx alot to those who helped

Sep 26, 2006, 02:05 AM
I'm not certain that what you propose is possible, as a "when" statement is more or less an if used in a dynamic context - such as cron script.

However you can do this a lot easier

Make a new script using the following instead:

tell application "application 1" to activate
tell application "application 2" to activate

name the script to say app 1 and use the same graphic, place it in the dock.

Sep 26, 2006, 09:47 AM
so you'd get:
tell application "Safari" to activate
tell application "Dashboard" to activate
Compile and save as an app. Paste the safari icon onto the new app and put it in your dock :)