• 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: make new finder window with properties {target:alias} falls short?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: make new finder window with properties {target:alias} falls short?


  • Subject: Re: make new finder window with properties {target:alias} falls short?
  • From: Paul Berkowitz <email@hidden>
  • Date: Fri, 18 Feb 2005 02:09:51 -0800

On 2/18/05 1:52 AM, "Brennan" <email@hidden> wrote:

> Hi there,
>
> A code snippet:
>
> tell application "Finder"
>   set a to alias "Mac HD:Users:Me:folder:"
>   make new finder window with properties {target:a}
>   end tell
> end tell
>
> This opens a new Finder window, but does not point it to 'a'
>
> The following code works
>
> tell application "Finder"
>   set a to alias "Mac HD:Users:Me:folder:"
>   tell (make new Finder window)
>     set target to a
>   end tell
> end tell
>
> I see a little flicker as it points itself to the right folder after
> opening. (Cosmetic detail which would be nice to iron out).
>
> Why does 'make with properties {target:alias}' fail?

Who knows? A bug maybe. But take a look at 'make' in the Standard Suite:

make: Make a new element
    make
         new type class -- the class of the new element
         at location reference -- the location at which to insert the
element
         [to reference] -- when creating an alias file, the original item to
create an alias to or when creating a file viewer window, the target of the
window
         [with properties record] -- the initial values for the properties
of the element
    Result: reference  -- to the new object(s)


See that [to] parameter for "when creating a file viewer window, the target
of the window"?


Try this:

 tell application "Finder"
  set a to alias "Mac HD:Users:Me:folder:"
  make new finder window to a
 end tell


Even if your Finder Preferences in the UI are to open new Finder windows in
column view, AppleScript ignores that and opens in icon view. But you can
change the view by script if you wish. You'd need to set a variable to the
new window and set its current view. (An 'update' in between might be
useful.)

--
Paul Berkowitz


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >make new finder window with properties {target:alias} falls short? (From: Brennan <email@hidden>)

  • Prev by Date: make new finder window with properties {target:alias} falls short?
  • Next by Date: Re: Photo ID from iPhoto Import?
  • Previous by thread: make new finder window with properties {target:alias} falls short?
  • Next by thread: Finder Timeout
  • Index(es):
    • Date
    • Thread