Okay, here's a tough one

Is there a way to get a file if I only have a partial of the name? All my files begin with 8384_, followed by the client code which could be three to six characters.
Is there a way to get the opened file with just the partial name? I’ve tried things like

get file (begins with "8483")

and

 get file (characters 1 thru four is "8483")

. Any thoughts?

Hi skipdidthis,

Give this a try:

set theFolder to path to desktop folder
tell application "System Events" to set theFiles to path of every file of theFolder whose name begins with "8483"

theFiles

Neat, Qwerty;

Works with an extension too:

set theFolder to path to desktop folder
tell application "System Events" to set theFiles to name of every file of theFolder whose name extension is "webloc"
set myFile to choose from list theFiles

which “Choose File” won’t do.

But you can limit what a user can select in the choose file with:

set theFolder to path to desktop folder as alias
tell application "Finder"
	set theFile to (choose file with prompt "Choose a file" default location theFolder of type {"JPEG"} without invisibles)
end tell

not as nice as the list though

Not as nice, maybe, but if there are a lot of jpegs to choose from or any digging down is required, much more powerful, perhaps. Playing with it, however, it seems that you must be careful with extensions: .png is Type PNGf for example.