On 01/12/2007, at 3:52 am, Sue wrote:

Can you explain further?  I googled command line utilities
(as, showing my ignorance, I don't know what those are),


OK, there's a few file-handling things you need to do ... For instance, here's an example outline of a FileMaker script to add a new image to your library:


1. Prompt the user for the file location

2. Check that it's an allowable file (eg, Correct file type? Not too big?). If so, continue...

3. Create a new record in the database to hold metadata about the file (type, size, dimensions, description, original location, etc)

4. Upload a copy of the file to the server repository named with its correct record ID.

5. Create a thumbnail to save into the database record.


Now much of this cannot be done with "vanilla" FileMaker, so you need to rely on either a plug-in (Troi File being very popular) or various utilities that you can use from a standard OS X installation. I'll pick step 4, which you could perform via FTP using the command-line utility "curl". In a Terminal window you'd write something like this:

curl -T '/Users/tim/Desktop/Opera.jpg' ftp://user:[EMAIL 
PROTECTED]/imagelibrary/100123.jpg

which would upload the image "Opera.jpg" from my desktop to a directory on my FTP server called "imagelibrary", and it would be stored on the FTP server with the name "100123.jpg" to match it to its database record number.

In order to execute that command from FileMaker, we'd turn it into an AppleScript:

do shell script "curl -T '/Users/tim/Desktop/Opera.jpg' ftp://user:[EMAIL PROTECTED]/imagelibrary/100123.jpg "

and then FileMaker can perform this using a Perform AppleScript step.

There's a little more to it than that in practice, because we need to check for errors, but that's the basic idea.

Also, you could use AppleScript's Image Events suite to create thumbnails, and various other AppleScript commands to prompt for the file location and get information about the file.

--
Tim Mansour <[EMAIL PROTECTED]>

Reply via email to