Re: get type of selected finder item
Re: get type of selected finder item
- Subject: Re: get type of selected finder item
- From: Laine Lee <email@hidden>
- Date: Tue, 11 Aug 2009 12:59:33 -0500
- Thread-topic: get type of selected finder item
On 4/23/09 11:44 AM, "Tobias Exner" <email@hidden> wrote:
> Steve, Luther and Michelle,
>
> thanks a lot, for the very quick and helpful answers.
>
Here's some more stuff, albeit very late.
--property infoitemlist : {"name", "creation date", "modification date",
"icon position", "size", "folder", "alias", "package folder", "visible",
"extension hidden", "name extension", "displayed name", "default
application", "kind", "file type", "file creator", "type identifier",
"locked", "busy status", "short version", "long version"}
property infoitemlist : {"folder"}
(*
on open (theobject)
realinfo(theobject)
end open
*)
on run
tell application "Finder"
selection
end tell
set theobject to result as alias
realinfo(theobject)
end run
on realinfo(fsobj)
set theRealInfo to (get info for fsobj)
set coll to ""
repeat with i in infoitemlist
set namelabel to i as Unicode text
if namelabel is "size" then
set sizesource to extract_usrf(theRealInfo, namelabel)
set item_size to round (sizesource / 1000) as real
set sizeresult to (item_size as text) & space & "K"
set coll to coll & return & namelabel & ":" & space & sizeresult
else
try
--set coll to coll & return & namelabel & ":" & space &
(extract_usrf(theRealInfo, namelabel) as text)
set coll to coll & (extract_usrf(theRealInfo, namelabel) as
text)
end try
end if
end repeat
set the clipboard to coll
display dialog "The info has been placed on the clipboard." buttons
{"OK"} default button 1
--display dialog coll
end realinfo
to extract_usrf(theRecord, fieldName)
script Ford
property r : theRecord
to extract() -- supply a dummy method
end extract
end script
set Arthur to run script "script Zaphod
property r : {}
to extract()
return " & fieldName & " of r
end extract
end
Zaphod"
set Ford's extract to Arthur's extract
return (Ford's extract())
end extract_usrf
--
Laine Lee
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden