Re: Return PDF default reader
Re: Return PDF default reader
- Subject: Re: Return PDF default reader
- From: kai <email@hidden>
- Date: Sun, 1 Apr 2007 17:56:39 +0100
On 1 Apr 2007, at 14:09, I wrote:
default_application for "pdf" (* or any other name extension *)
Actually, that's not quite true - since the default app can be
determined by more than just the filename extension. Seems to work
for stuff like "pdf", "html" and "scpt" - but not for "emlx",
"plist", "icns", etc.
I suppose another option might be to search for a genuine file. This
could take a while longer, and may fail if no match is found - but
FWIW...
----------------------
on default_application for extn
try
set e to quoted form of ("." & extn)
(info for POSIX file (do shell script ¬
"mdfind kMDItemFSName == " & e ¬
& " | grep -m 1 " & e))'s default application
on error
missing value
end try
end default_application
default_application for "pdf"
----------------------
---
kai
_______________________________________________
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