• 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: choose file of type
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: choose file of type


  • Subject: Re: choose file of type
  • From: Bill Briggs <email@hidden>
  • Date: Fri, 25 Nov 2005 16:50:10 -0400

Looks like it's "public.plain-text" for text files. When I run this:

tell application "Finder"
	set a_file to selection as alias
	set UTI to type identifier of (get info for a_file)
end tell

and I have a text edit file selected, that's the result. If I select an Excel file it's "com.microsoft.excel.xls"

Looks like the UTI is tied to the extension. When I run this:

choose file of type {"public.plain-text"}

I can select, for example, text files with a .txt extension, but not text files with a .html extension.

There's a table of UTIs, MIME types, and File Extensions here that's worth a short look.
http://www.huw.id.au/code/fileTypeIDs.html

- web

At 12:14 PM -0800 11/25/05, Paul Berkowitz wrote:
>In Tiger (maybe Panther too?), 'choose file's parameter 'of type' is now
>described as "a list of file types or type identifiers."
>
>Can someone remind me what is meant by a "type identifier"? I do recall that
>you can't mix them in with 4-char file types - it has to be one or the
>other.
>
>I'm hoping that it has something to do with extensions, or even the
>creator's identifier, so that it can work with files that don't have the old
>style file types. For example, isn't there some way to specify .txt files as
>made by TextEdit, which do not have "TEXT" file types?
>
>    choose file of type {"txt"}
>
>or {".txt"}, or {"ttxt"}, or {"text"}, or {"com.apple.TextEdit"}, or
>{"****"} - no .txt files created by TextEdit files are selectable in 'choose
>file'. Is there a way? GetInfo has TextEdit set as default app for opening
>them, if that matters.
>
>Ultimately, I'm also hoping to  be able to specify .doc or .xls files coming
>from Word or Excel on Windows, with no file types.
>
>If there isn't some way to specify extension, there should be.
>
>--
>Paul Berkowitz
>
>
> _______________________________________________
>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

 _______________________________________________
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

  • Follow-Ups:
    • Re: choose file of type
      • From: Paul Berkowitz <email@hidden>
References: 
 >choose file of type (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: choose file of type
  • Next by Date: encore Re: choose file of type
  • Previous by thread: choose file of type
  • Next by thread: Re: choose file of type
  • Index(es):
    • Date
    • Thread