Finding Searching folder or filename in Finder

I have a filemaker database of job orders for our company. All jobs have corresponding folders on our server that contain the job number. When a user selects a particular job in the database, I want to find the corresponding job folder on the hard drive and open it. Using OS9.2, is there a way around scripting Sherlock(yuk!) to do this? If not, what is the proper way to do this with Sherlock? I’m not sure how to pass parameters from filemaker to Applescriipt, but was thinking about copying job number to clipboard and then executing Applescript to find folder that contains job number inserted from clipboard.

Please help! Thanks, Chris

Forget Sherlock, just pass the data from your FMPro Job Number field to Applescript and pop the folder open. I use this for a similar function. It really helps if all your job folders are located within a root folder (all in the same folder). But not necessary - it just makes programming what you need a little harder.

Here’s an example script you can attach to a FileMaker button. It shows how to pull data from a FileMaker field, piece it together with the path to your root folder, and make your selected job folder stand at attention. Just make the necessary changes to database and cell name and define the path to your root folder. If you have any problems post them back here.

Best regards.

--if you know the root folder that houses your job folders define that here
--if all of your job folders are not within a single "root" folder this will be a little tougher but still doable
set rootFolder to "Volume or Disk Name:Root Folder Name:"

tell application "FileMaker Pro"
	--set up a reference to the current record of your database
	set currRec to a reference to the current record of database "jobs" --or whatever yours is named
	--get the contents of the job number cell
	set jobNumber to get data cell "Job Number" of currRec
end tell

set jobPathString to rootFolder & jobNumber & ":" as string --note how it ends with a colon (it is a folder)

--check to see if the folder exists
try
	set jobPathAlias to jobPathString as alias
	--if it exists it will make it to the next line which should open the existing folder
	tell application "Finder"
		activate --optionally bring the Finder to the front (bring the popped folder above all else)
		open jobPathAlias
	end tell
on error --if this fails, the folder does not exist in which case you can either flash a dialog or just beep 5 times
	display dialog "Sorry, that folder does not exist..." with icon note
	--beep 5
end try

Hey Chris,

I’ve done a lot of work for a client that has the exact same setup: FM database with job numbers & a server that has those folders with job numbers. A job number might look like AZ12345, but on the server the folder name might be “Phoenix AZ12345” or “Tucson AZ12345”. So that made it hard to know exactly what the folder name would be.

Lucky for us David Blache with Microcosm Software just updated one of his apps for OS X. It’s called ‘FindFilesX’. It’s basically a faceless file search app. Very fast and very very functional. Use AppleScript to send a request to FindFilesX and it will search in any folder you specify for any of the following: file name (or partial name), file type, size, kind, crator/modification date, and so on.

No, I’m not a salesman, nor do I get a kickback. But it’s an amazing piece of software.
http://microcosmsoftware.com/findfilesx/

There’s also an osax version for OS 9:
http://microcosmsoftware.com/findfileosax/

Best of luck,
Malcom