Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Getting the Finder selection

Getting the Finder selection
Thread Tools
Mac Enthusiast
Join Date: Apr 2000
Location: Belgium
Status: Offline
Reply With Quote
Feb 22, 2002, 06:26 AM
 
I used to use AppleEvents to get the Finder's selection in MacOS 9 but this has stopped working in OS X. The returned list has a correct count (the count of the selected items in the Finder) but I can't do anything with the items in the list itself?
The AppleEvent used is 'getd'/'core', with '----'/'sele' objectspecifier, and 'rtyp'/typeFSRef (also tried 'rtyp'/typeFSS). No matter what I try, whatever is in that list will not be used as a FSRef or an FSSpec.
Anyone have any ideas of how to fix this without using AppleScript (it's so damn slow) ?
PowerMac G4 400MHz/832MB/60GB
AlBook G4 15" 1.25GHz/1.5GB/60GB
Athlon 64 3500+/Asus A8N-SLI Premium/2GB RAM/990GB HD/GF7800GT 512
     
Mac Enthusiast
Join Date: Apr 2000
Location: Belgium
Status: Offline
Reply With Quote
Feb 28, 2002, 04:41 AM
 
Aw, anyone? It's quite urgent.
PowerMac G4 400MHz/832MB/60GB
AlBook G4 15" 1.25GHz/1.5GB/60GB
Athlon 64 3500+/Asus A8N-SLI Premium/2GB RAM/990GB HD/GF7800GT 512
     
Dedicated MacNNer
Join Date: Jun 2000
Location: Dundas, Ontario, Canada
Status: Offline
Reply With Quote
Feb 28, 2002, 08:23 AM
 
What are you trying to do? Is this just you selecting things in the Finer and wanting your App to take notice or are you trying to drag & drop selections onto your app or something like that?

I don't know how to handle the former but I have done work with things like the latter if that is what you need.

Jeff.
Spectral Class
"Shedding Light on Innovation"
     
Grizzled Veteran
Join Date: Feb 2001
Location: Germany
Status: Offline
Reply With Quote
Feb 28, 2002, 08:51 AM
 
might be a bit dirty, but using /usr/bin/osascript from an nstask seems to work...
     
Mac Enthusiast
Join Date: Apr 2000
Location: Belgium
Status: Offline
Reply With Quote
Mar 1, 2002, 05:27 AM
 
Originally posted by Apocalypse:
<STRONG>What are you trying to do? Is this just you selecting things in the Finer and wanting your App to take notice or are you trying to drag & drop selections onto your app or something like that?

I don't know how to handle the former but I have done work with things like the latter if that is what you need.

Jeff.</STRONG>
It's the former. My app shows previews of pictures that get selected in the Finder.
PowerMac G4 400MHz/832MB/60GB
AlBook G4 15" 1.25GHz/1.5GB/60GB
Athlon 64 3500+/Asus A8N-SLI Premium/2GB RAM/990GB HD/GF7800GT 512
     
Mac Enthusiast
Join Date: Apr 2000
Location: Belgium
Status: Offline
Reply With Quote
Mar 3, 2002, 05:47 AM
 
Been doing some research and it looks like the MacOS X Finder just plainly ignores the requested type specifier and always returns something that resembles the AppleScript description of a file; like { document "bla" of folder "bleh" of startup disk }, but in something I can't quite place. It contains a bunch of OSTypes (seld, want, form, from, enum, obj, docf, cfol, indx, utxt) and UniCode text for the names of each item in the description. Each item returned by the Finder starts of with a list of entries which are either pointers to a document (docf), folder (cfol), or volume (disc/sdsk) descriptions later on in the file, starting with the docf (contains 'docf', 'from', 'obj ') and ending with the disk ('disc', 'from', 'null'). Then come the descriptions to which these items point, containing the OSTypes 'enum', 'indx', and a UniText string for the name of the item.
I don't know how to resolve this thing to a FSRef, anyone have any ideas?
PowerMac G4 400MHz/832MB/60GB
AlBook G4 15" 1.25GHz/1.5GB/60GB
Athlon 64 3500+/Asus A8N-SLI Premium/2GB RAM/990GB HD/GF7800GT 512
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:09 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2