Re: What type is the finder selection?
Re: What type is the finder selection?
- Subject: Re: What type is the finder selection?
- From: Doug McNutt <email@hidden>
- Date: Mon, 12 Aug 2002 21:31:40 -0600
At 14:01 -0700 8/12/02, Christopher Nebel and Michelle Steiner got me into looking at class. I appreciate the help. It works so long as one doesn't try to pick the items out of the list generated with a drag and drop operation onto an applet.
-- this section runs properly while in the script editor
tell application "Finder"
set argList to selection
repeat with theTarget in argList
set theType to class of theTarget
if theType is alias file then
try
set theTarget to original item of theTarget
set theType to class of theTarget
end try
end if
if (theType is disk) or (theType is folder) then -- ignore anything that's not a folder
my doInit()
my doStuff(theTarget, thePlace) -- thePlace is global set by doinit()
end if
end repeat
beep
end tell
But dropped items come through as class "alis" a four byte object. I am at the three hour point trying to figure out what to do with them. Here's what I have tried; nothing has yet worked:
on open (argList)
tell application "Finder"
display dialog argList
repeat with theAlias in argList
display dialog theAlias
set aTemp to theAlias as string -- ASLG page 305
set theTarget to aTemp as file -- class becomes "fss", file spec != file?
--set theTarget to theAlias as string -- class becomes TEXT
--set theTarget to file (theAlias as string) -- class becomes TEXT
--set theTarget to original item of theAlias as file -- just fails. alis != alias I guess
set theType to class of theTarget
** SNIP - same as above
end repeat
beep
end tell
end open
--
--> Life begins at ovulation. Ladies should endeavor to get every young life fertilized. <--
_______________________________________________
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.