Re: Getting Info from the Finder
Re: Getting Info from the Finder
- Subject: Re: Getting Info from the Finder
- From: "Mark J. Reed" <email@hidden>
- Date: Tue, 18 May 2010 09:42:39 -0400
Here's a handler that uses mdls to build up an AS record containing
the data you want, with no requirement for satimage:
to getCreatorInfo(myFile)
set shellCommand to ¬
"mdls -raw -name kMDItemCreator -name kMDItemEncodingApplications " ¬
& (quoted form of (POSIX path of myFile)) ¬
& " | sed -e 's/^ *\"\\(.*\\)\"/\\1/' "
set oldTIDs to text item delimiters
set text item delimiters to character id 0
set {creator, encodingAppText} to ¬
text items of (do shell script shellCommand)
set text item delimiters to oldTIDs
tell paragraphs of encodingAppText
set encodingApplications to its items 2 through (length - 1)
end tell
return { Creator: creator, EncodingApplications: encodingApplications }
end getCreatorInfo
Which you could then use like this:
set myFile to choose file
tell getCreatorInfo(myFile)
set myInfo to "Creator: " & its Creator ¬
& ", Producer: " & its EncodingApplications as text
end
--
Mark J. Reed <email@hidden>
_______________________________________________
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