Well, after spending the whole day... I think it is really hard to do.

I haven't gotten anywhere yet, but if I find out something I will post it of course :)
I cannot imagine that this is an uncommon task...

Cheers,

André


--- Original Nachricht ---
Absender: André Berg
Datum: 01.07.2009 10:35 Uhr
Hi David,

Thanks for replying :)

Actually I am coming from a v0.1 version of my program, was trying to implement this with AppleScript Studio. The Finder's dictionary has a "select" command but it appears that this command does nothing more than to call said NSWorkspace method. The behaviour of executing the "select" command/method in a loop, with the same set of path strings, once using pure Cocoa and once using pure AppleScript is exactly the same. It will open a new Finder window for every path string entry in the array.

It *is* possible to supply the whole AppleScript list (AppleScript list = NSArray) to the Finder's select command (if you convert the POSIX path-style strings in the list to file URLs via "POSIX file") and the "select" command is
smart enough to make a selection of all items in the frontmost window ...
... but only for the current folder level.

The problem with expanded subfolders in list view remains. Any paths that point to files with expanded subfolders will spawn a new Finder window each. I am currently experimenting with looping through the subfolders, issueing a NSAppleScript script that passes a list of POSIX files representing each subfolder's contents every cycle of the loop, but it looks like it's not keeping the selection in the parent folder if I go to target a subfolder in the next loop cycle...

Thanks for the pointer to the AE docs. Until now I have always been shying away from reading those as raw AppleEvents are still confusing the heck out of me. Seems there's no excuse left now .... unless there's some other way?


Cheers

André

--- Original Nachricht ---
Absender: Dave Keck
Datum: 01.07.2009 7:20 Uhr
I'd imagine the easiest way to do this is using an AppleScript, which
can be embedded in your app using the NSAppleScript class.

But I've got a whole lot of PTSD towards AppleScript, so if it were
me, I would deal with the AppeEvents directly, much as it's done here:

http://developer.apple.com/documentation/Applescript/Conceptual/AppleEvents/create_send_aepg/create_send_aepg.html

David

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/andre.berg%40email.de

This email sent to andre.b...@email.de

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to