• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Finder windows: opening in same, closing parent
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finder windows: opening in same, closing parent


  • Subject: Re: Finder windows: opening in same, closing parent
  • From: Graff <email@hidden>
  • Date: Sun, 11 Apr 2004 03:50:13 -0400

On Apr 11, 2004, at 2:33 AM, Jim Witte wrote:

How can I emulate the Cmd-Opt-Double-Click behavior of the Finder,
which opens a folder and then closes the parent window? I've got the
following

You can grab the front window and close it, then you can open the folder which is selected:
----------
tell application "Finder"
set theFolder to selection
set theWindow to the front window
close theWindow
open theFolder
end tell
----------

This doesn't check to see if the selection is a folder, you probably should do that just in case the selection is a file. Also there may be more than 1 item selected and this will open them all.

Also, is there a way to tell the Finder to open a folder in the same
window?

You can change the target of an open window:
----------
tell application "Finder"
set theFolder to selection
set theWindow to the front window
set target of theWindow to (theFolder as alias)
end tell
----------

Again, this doesn't check to see if the selection is a folder, you probably should add that in to be safe. You probably also want to make sure that only 1 item is selected or that you only use 1 item if multiple items are selected. If you don't have just 1 item then the script will fail.

- Ken
_______________________________________________
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.


  • Follow-Ups:
    • Re: Finder windows: opening in same, closing parent
      • From: Jim Witte <email@hidden>
References: 
 >Finder windows: opening in same, closing parent (From: Jim Witte <email@hidden>)

  • Prev by Date: Finder windows: opening in same, closing parent
  • Next by Date: Re: Just submitted this to BugReporter as feature request - comments...
  • Previous by thread: Finder windows: opening in same, closing parent
  • Next by thread: Re: Finder windows: opening in same, closing parent
  • Index(es):
    • Date
    • Thread