Re: Setting Finder Preferences and Folder Views
Re: Setting Finder Preferences and Folder Views
- Subject: Re: Setting Finder Preferences and Folder Views
- From: Nigel Garvey <email@hidden>
- Date: Thu, 21 Feb 2002 17:36:59 +0000
Mr Tea wrote on Thu, 21 Feb 2002 14:34:59 +0000:
>
This from Nigel Garvey - dated 21/2/02 01.40 pm:
>
>
> I don't know of any way to script the changing of this in an existing
>
folder,
>
> but when creating new ones, it's possible to take advantage of the fact
>
that
>
> when a new folder's created, it takes on the characteristics of the
>
folder in
>
> which it's created. (At least, it does on my machine.)
>
>
FYI - This doesn't work reliably in OS X.
And I've just discovered that it's also not the case in OS 9.2.1 for
folders created with the 'New' button in the 'choose file name' dialog.
>
An alternative way would be to
>
duplicate the 'stationery' folders, which does retain the selected view
>
options in X.
That's a much better idea anyway, Mr Tea. Thanks!
-- Predefine myStationaryFolder
-- 'choose file name' was 'new file' before AS 1.(6?)
set newFolder to (new file with prompt "Save the new folder as...?") as
string
set AppleScript's text item delimiters to {":"}
set folderName to newFolder's last text item
set newHome to newFolder's text 1 thru text item -2 & ":"
set AppleScript's text item delimiters to {""}
tell application "Finder"
duplicate myStationaryFolder to folder newHome
set the result's name to folderName
open folder newFolder
end
If this is implemented as a folder action, as in my previous script, the
stationary folder shouldn't be the one with the script attached, as
otherwise the Folder Actions application gets upset. In fact, a folder
action doesn't seem such a good idea to me now - which is a shame as this
is the only use I've ever found for one. :-)
NG
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.