• 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: "email@hidden" <email@hidden>
  • Date: Sat, 23 May 2009 13:39:03 -0700


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.


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      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: changing the "open with application" value for a file
      • From: M Pulis <email@hidden>
    • Re: changing the "open with application" value for a file
      • From: "John C. Welch" <email@hidden>
References: 
 >changing the "open with application" value for a file (From: Jim Brandt <email@hidden>)
 >Re: changing the "open with application" value for a file (From: "email@hidden" <email@hidden>)
 >Re: changing the "open with application" value for a file (From: Jim Brandt <email@hidden>)

  • Prev by Date: Re: Facespan 5 Development Suspended
  • 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: Re: changing the "open with application" value for a file
  • Index(es):
    • Date
    • Thread