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: M Pulis <email@hidden>
- Date: Sat, 23 May 2009 16:25:56 -0700
On May 23, 2009, at 1:39 PM, "email@hidden" <email@hidden>
wrote:
OK, so where do the types come from?
If the file is created on a Mac application, the creator type and
file type are automatically generated by the mac application.
beware of that assumption!
An app can create a file with type and creator blank or any 4char
value. that is how we have created export files that open in other
apps. there is no way to tell we created that file.
Gary
If the files come from Unix or Windows or via a process like FTP,
that ignores resources, they are not there.
WHen they're not there, the system uses the file name extension.
On the mac side, the creator type identifies the application that
created the file. The file's file type identifies what kind of file
it is. For example, InDesign creates both templates and documents.
The creator type is the same for both but the file type is
different. The OS uses file type to determine which icon to display
and uses the file type to determine which application to open the
file in.
The system uses the creator type to automatically determine which
application will open a particular file type, the first time a user
tries to open a file. That's what gets overridden when using info
for or scripting the default application. That's a global,
persistent, setting. Set it once and it works that way for all files
of that type until it's changed.
It sounds like you want a droplet to show the file type of selected
files.
on open FileList
tell application "Finder"
try
set myType to file type of myFile
on error
set myType to ""
end try
try
set myCreator to creator type of myFile
on error
set myCreator to ""
end try
try
set myExtension to name extension of myFile
on error
set myExtension to ""
end try
set displayString to {""}
set the end of displayString to {"File: " & myFile}
set the end of displayString to {"File type: " & myType}
set the end of displayString to {"File creator: " & myCreator}
set the end of displayString to {"File extension: " & myExtension}
set AppleScript's text item delimiters to {return}
display dialog displayString as text
end tell
end open
Once you have a type, creator and extension combo that works
consistently, you could easily use a script to change those settings
on any file dropped on it.
HTH
ES
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (applescript-
email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
_______________________________________________
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