Filemaker & Searching for File in Finder
Filemaker & Searching for File in Finder
- Subject: Filemaker & Searching for File in Finder
- From: "Mara Jade Skywalker" <email@hidden>
- Date: Wed, 1 Mar 2006 21:44:03 -0700
--I'm relatively new to AS and have been searching the net for hours looking for help for my problem but with no luck. I hope someone here can help me.
--Brief synopsis:
--I have a FilemakerPro8 file (saved as .fp7) that has three specific fields of relevance:
--1) "SKU"-a text field containing a unique identifier (no other record has this number), which also corresponds to a graphic file on an image server.
--2) "Image"-a container where I want the graphic mentioned in #1 to be stored as a reference only
--3) "Image_Path"-a text field where I want the file path to reside.
--Here's the code I have so far:
tell application "FileMaker Pro 8.0"
tell document "FileName.fp7"
tell window 1
tell layout "Layout #1"
tell current record
set sku_name to cell "SKU"
display dialog sku_name
end tell
end tell
end tell
end tell
end tell
--This works, and I only have the display dialog to make sure that the correct text is being saved as the sku_name variable. The working version will have this bit removed.
set search_folder to "Server:Folder1:Folder2:" as alias
--note, there are sub-folders of Folder2 that I want to search, but everything I've read indicates that pointing to a folder with a search parameter will search subfolders as well. Please correct me if I'm wrong on this.
tell application "Finder"
Search for file whose name is sku_name ¬
in folder search_folder
set image_file_alias to result as text
display dialog image_file_alias
end tell
--Here's where things just go to pot (again, display dialog is used to verify what's being returned here). On the event log (and dialog box), The result from the second bit of code returns:
--"Can't get file whose name = sku_name of folder (alias \"Server:Folder1:Folder2:\")."
--Then I need Filemaker to put the picture reference of the file that it finds (there's only going to be one that matches the find criteria) in the "Image" field, and the textual file path in the "Image_Path" field.
tell application "FileMaker Pro 8.0"
tell document "FileName.fp7"
tell window 1
tell layout "Layout #1"
tell current record
copy image_file_alias to cell "Image_Path"
end tell
end tell
end tell
end tell
end tell
--Since I can't even get the textual filepath to work, I've not attempted to put in a reference to the actual image itself, that will be the next step when I get this working.
--I've tried to be brief, but if you need more information, please let me know. Also, I have tried using a "choose" file option, and then the file path will work, but this needs to be a completely automated process, because we have to add upwards of 4000 images to an existing database and I want to put this script into a repeating loop.
--Any help is greatly appreciated.
--Thanks,
--Tina
--Applescript Newbie
_______________________________________________
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