Re: 'choose file of type' - more than we might have thought [was: Finding only visible files...]
Re: 'choose file of type' - more than we might have thought [was: Finding only visible files...]
- Subject: Re: 'choose file of type' - more than we might have thought [was: Finding only visible files...]
- From: Kai <email@hidden>
- Date: Sun, 29 Jun 2003 14:04:02 +0100
on Fri, 20 Jun 2003 05:05:52 -0700, "Domains4Days.com" wrote:
>
I am curious, it was mentioned that in this instance, you can only select up
>
to four file types.
Well, that's what the dictionary tells us:
----------------------------------------------
choose file: Choose a file on a disk or server
choose file
[with prompt plain text]
-- a prompt to be displayed in the file chooser
[of type a list of plain text]
-- restrict the files shown to only these file types (up to 4)
Result: alias -- to the chosen file
----------------------------------------------
>
For my particular case, I would like to search for ALL
>
file types - and simply omit invisible files.
>
>
Is there another way to write the script (kind of backwards thinking...)
>
>
... Some correct version of this ...
>
??? set theFilePath to (choose file of type ???NOT {invisible}???) as string
Yeah, know what you mean. That might be useful - but no dice, I'm afraid.
When you first raised this, I tried stuff like 'choose file of type
{"****"}' (which usually means 'anything') - but that, along with a bunch of
other variations, didn't work either.
However, it struck me today that I wasn't wearing my cynic's hat at the
time. (You know - the creamy, furry, pointy one with the words "Don't
believe a word anyone tells you!" etched into the expensive designer label
at the back).
Anyway, seems that at some time, someone kindly removed the four item
restriction (works here, anyway) - but apparently didn't get around to
amending the dictionary (or ASAG).
That's the good news. :-)
There are a couple of downsides, but nothing too surprising:
* you still need to identify every file type you want to include
* the longer the list of file types, the longer it takes to
display the dialog
In view of this, you may want to think about which file types you really
want to show - to keep the list down to a manageable length.
To demonstrate the potential problem, I scanned one of my smaller hard
drives to collect a list of the file types on it. (Obviously, the type of
files on any particular machine will depend to some extent on which
applications are being used to create them.)
Since a few of the file types contained some of the more... esoteric ASCII
characters, I've had to resort to a little subterfuge in an attempt to sneak
them past the list server's mangle. (However, if you know which types you
want to include, the simpler, 'choose file of type {a, b, c, d, e}' form
should do the trick.)
Anyway, FWIW...
-------------------------------------------------------
(Any wrapped lines abutting the left edge of the window
should be reconnected to the end of the previous line)
-------------------------------------------------------
--========
script s
set {b, e, l, d} to {(ASCII character 199) & "data cstr", "00" &
(ASCII character 200) & " as string", {"8BPF", "????", "aam ", "acdp",
"ACSR", "adev", "adrp", "aedb", "afpp", "AIFF", "AINI", "Alic", "almb",
"almn", "ALTH", "ALTq", "APPC", "APPD", "appe", "APPL", "APrf", "ASSP",
"ASST", "aupf", "BART", "BINA", "BKMK", "blrb", "BOBS", "BOEK", "BTFL",
"cbnd", "cdev", "CGdb", "chgd", "cidb", "cidm", "Clad", "CLIP", "clpp",
"clpt", "CLRS", "Clss", "CMdt", "cmpi", "comd", "CPnl", "cpup", "CUdt",
"CWDB", "CWGR", "CWPR", "CWSS", "CWWP", "data", "dCLU", "dfil", "dGRD",
"dict", "dimg", "dPPT", "drop", "ds75", "dspf", "ecpg", "eqps", "ESET",
"expt", "faam", "fact", "fast", "FBAL", "fbce", "fdrp", "FERP", "FFIL",
"find", "Fltr", "fmBM", "fmCF", "FMP3", "FMTR", "FMXT", "FNDR", "FNET",
"FOPX", "GIFf", "GRA ", "HDNI", "help", "hkdb", "HMHD", "HMSD", "hplg",
"HYPH", "ICAp", "iDLL", "ilht", "ilma", "INIT", "issp", "JPEG", "kndr",
"lcfl", "libr", "LINK", "List", "LWFN", "LWKS", "lzcn", "lzlg", "lzpf",
"Main", "mdpf", "mixn", "mlts", "MooV", "MPG3", "MSGD", "MSGR", "MSIF",
"MSMF", "MSTF", "MSTH", "MTHH", "MTV2", "Ncch", "ndrv", "npdt", "NSPL",
"OECl", "OEDB", "osas", "osax", "otcf", "otgl", "OTLB", "otnc", "otsc",
"otsl", "otsv", "PArT", "PDF ", "PEPS", "PICT", "pltn", "plug", "pma!",
"PNch", "PNGf", "PNRA", "poco", "PPOT", "PPSS", "pref", "PRER", "PRES",
"prof", "ProG", "pshr", "qtif", "RDEV", "RECO", "rohd", "RSET", "rsrc",
"RULE", "SACM", "sbkt", "scen", "Schd", "sclr", "scri", "sdev", "sEXT",
"sfil", "shlb", "Sigs", "SIT5", "SLD3", "SLD8", "sLS8", "SndS", "SnuP",
"STAK", "STOT", "sWDB", "sWGR", "swpl", "sWPR", "sWPT", "sWWP", "tbxi",
"TERO", "TEXT", "TH02", "thng", "tsnd", "ttft", "ttro", "ttsf", "ttsp",
"ttvf", "TVex", "ULAW", "URL ", "User", "utbl", "W8TN", "WAFF", "WDAB",
"WDCD", "WDEP", "WDGP", "WDHY", "WDLL", "WIZ!", "XCLD", "XCLp", "xfnt",
"XLA8", "XLB8", "XLL ", "XLM4", "XLPF", "XLS ", "XLS3", "XLS4", "XLS5",
"XLS8", "XTND", "XTRL", "YMon", "ZIP ", "zsyr", "zsys"}, {"00000000",
"4D448A74", "4D4772C4", "4D709566", "4D70954C", "4D70A8C4", "4D539664",
"B54D8C46", "B54D5352", "B54DA446", "B54DBD46", "BA8CC2C2"}}
repeat with i in d
set l's end to run script b & i & e
end repeat
l
end script
property t : run script s
choose file of type t
--========
--
Kai
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.