Re: changing the "open with application" value for a file
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