• 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: setting default app for document
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: setting default app for document


  • Subject: Re: setting default app for document
  • From: yvan-koenig <email@hidden>
  • Date: Mon, 7 Mar 2005 22:21:15 +0100


Le 6 mars 2005 , à 21:40, kai a écrit :


On Sun, 6 Mar 2005 09:55:50 -0500, Glenn Kowalski wrote:

I searched the archives for this but came up with a blank. Is there a way to set the default application for a document? I've tried

tell app Finder

set default application of "blah blah blah document path" to "blah blah blah application path"

end tell

---------------

set f to choose file with prompt "Please choose a file to convert:"
set a to choose application with prompt "Choose a default application:"
tell application "Finder"
	set f's creator type to (path to a)'s creator type
	open f
end tell

---------------

If I remember well, your script grabbing the application open the app itself , and returns a UNICODE string which is not the correct format to set a creator type (Text required)


perhaps this one may help

tell application "Finder"
set f to choose file with prompt "Please choose a file to convert:"
set theFile to choose file with prompt "Choose a default application:"
set theTrueFile to "" & theFile & ":Contents:PkgInfo" (* build the complete path *)
set ct to read (theTrueFile as alias)
set creatortype to text 5 thru -1 of ct
set f's creator type to creatortype
end tell


Yvan KOENIG


_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Re: setting default app for document (From: kai <email@hidden>)

  • Prev by Date: Re: question about iPhoto scripting
  • Next by Date: one-line review of "Applescript: The Missing Manual"
  • Previous by thread: Re: setting default app for document
  • Next by thread: Re: setting default app for document
  • Index(es):
    • Date
    • Thread