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: Axel Luttgens <email@hidden>
- Date: Fri, 20 Aug 2010 17:28:08 +0200
Le 19 août 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.
>
> Snow Leopard.4, on my MacBook Pro with various third-party utilities, intermittently "forgets" to reopen the Finder windows that were open when I powered down.
>
> Could someone please tell me how to write an AppleScript that would compile a list of the currently open Finder windows? I would then use that 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
_______________________________________________
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