• 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: changing the "open with application" value for a file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: changing the "open with application" value for a file


  • Subject: Re: changing the "open with application" value for a file
  • From: Luther Fuller <email@hidden>
  • Date: Sat, 23 May 2009 13:00:04 -0500

On May 23, 2009, at 12:16 PM, Jim Brandt wrote:

Under OS X, what is it that determines which application opens a
file when it is double clicked and how is it manipulated via
Applescript?

Perhaps this is what you need ...

set filePath to "startupdisk:Users:username:Desktop: Name_Of_File.mp3"
-- this file opens with QuickTime Player when double-clicked

tell application "System Events"
	set defAppl to default application of file filePath
	name of defAppl as text
end tell
display dialog the result -- returns "QuickTime Player"

set applPath to (path to application "iTunes") as text
tell application "System Events"
	set default application of disk item filePath to applPath
end tell
-- the file will now open with iTunes

_______________________________________________
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: 
 >changing the "open with application" value for a file (From: Jim Brandt <email@hidden>)

  • Prev by Date: Re: changing the "open with application" value for a file
  • Next by Date: Re: changing the "open with application" value for a file
  • Previous by thread: Re: changing the "open with application" value for a file
  • Next by thread: Swap foreground and background windows
  • Index(es):
    • Date
    • Thread