Re: Remember Finder windows left open at shutdown
Re: Remember Finder windows left open at shutdown
- Subject: Re: Remember Finder windows left open at shutdown
- From: Donald Hall <email@hidden>
- Date: Fri, 20 Aug 2010 20:18:26 -0600
Two suggestions:
1. Add logging out to Axel's first script, put it
in the Scripts menu, and use it to log out
instead of the command under the Apple menu.
You can log out with
tell application "System Events" to log out
You might also find this hint useful:
http://hints.macworld.com/article.php?story=20080315064646576
2. I publish a program called Script Timer that
has an easy way to schedule scripts to run at log
in time. See http://www.appsandmore.com for the
details. You could use it to schedule the 2nd
script.
Script Timer also has a way to schedule scripts
at log out time, but it runs after the Finder is
done, so it wouldn't be of use here.
Hope this helps,
Don
At 19:52 -0600 20/08/10, Donald Hall wrote:
Le 19 aot 2010 ý 01:11:55, Barry Fass-Holmes a Ècrit :
> Hello,
I've searched the web, Apple's discussion
forum on AppleScript, and this listserv's
archives without finding a relevant posting.
...snip...
... in another AppleScript to reopen those
windows upon execution after logging in so that
the windows reopen after a cold bootup.
Hello Barry,
Here follows a very sketchy attempt.
Before logging out, you could save some basic
information about the currently open windows:
tell application "Finder"
set {PrevTargets, PrevBounds} to
{target, bounds} of Finder windows
end tell
If PrevTargets and PrevBounds are global
variables, their values should be preserved when
the applet quits.
For restoring the windows after logging in:
tell application "Finder"
set CurrTargets to target of Finder windows
repeat with I from (count of PrevTargets) to 1 by -1
if {item I of PrevTargets} is not in CurrTargets then
if exists item I of PrevTargets then
tell (make new Finder window)
set {target, bounds} to {item I of
PrevTargets, item I of PrevBounds}
end tell
end if
end if
end repeat
end tell
Of course, you'll need to devise a way to run
the required piece of code (saving or restoring)
at the right time...
HTH,
Axel
--
Donald S. Hall, Ph.D.
Apps & More Software Design, Inc.
email@hidden
http://www.appsandmore.com
_______________________________________________
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