• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Return PDF default reader
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Re: Return PDF default reader (From: kai <email@hidden>)
 >Re: Return PDF default reader (From: kai <email@hidden>)

  • Prev by Date: Re: Return PDF default reader
  • Next by Date: Re: Quietly Distill a file
  • Previous by thread: Re: Return PDF default reader
  • Next by thread: Re: Quietly Distill a file
  • Index(es):
    • Date
    • Thread