Re: Run AppleScript in the background (hide window)
Re: Run AppleScript in the background (hide window)
- Subject: Re: Run AppleScript in the background (hide window)
- From: Ed Stockly <email@hidden>
- Date: Tue, 12 Feb 2008 22:46:45 -0800
I'm working on an AppleScript that change settings in the System Preference window, and because I'm using this script from a Dashboard Widget, I'd like to run the AppleScript in the background so I don't see the System Preference window and it doesn't leave Dashboard while running the script.
Hmmm, I didn't think you could use GUI scripting on an app that's in the background. I think that violates the natural order of things.
But here's a couple things to try
open the system preferences window, drag it to the bottom right corner of the screen so the only thing that's visible is the very top very left corner of it's window.
tell application "System Preferences" activate return bounds of window 1 end tell -- then paste the result into the beginning of your script. When you run your script System Preferences would be front most but the window would be out of view.
You could also try something like this: tell application "System Preferences" set bounds of window 1 to {-10, -10, 0, 0} activate end tell
I haven't tested either of these on my mac. (don't want to break anything)
But give it a try and let us know how it works out.
ES =
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden