Re: open & close in Finder
Re: open & close in Finder
- Subject: Re: open & close in Finder
- From: Paul Berkowitz <email@hidden>
- Date: Tue, 20 May 2003 11:14:31 -0700
On 5/20/03 10:32 AM, "Mitchell, John" <email@hidden> wrote:
>
OSX 10.2.5, SD 3.0.6, AS ?? where do I find it?
The simplest way is in any script editor:
AppleScript's version
>
>
could someone guide me as to why the open works, but the close doesn't
>
>
tell application "Finder"
>
open folder ("mitchX:Users:johnMitchell:Documents:Review 1,
>
Paris:" as alias)
>
close folder ("mitchX:Users:johnMitchell:Documents:Review 1, Paris:"
>
as alias)
>
end tell
>
1) When you open the folder, the Finder creates a window for it.
Technically, it's the window that is now open, not the folder. The window is
known by its name, not the full path to the folder.
2) You should not be adding 'as alias'. That forces two coercions where none
is necessary.
tell application "Finder"
set folderPath to "mitchX:Users:johnMitchell:Documents:Review 1, Paris:"
open folder folderPath
set folderName to name of folder folderPath
close window folderName
end tell
--
Paul Berkowitz
_______________________________________________
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.