Re: FileMaker Pro, get image by reference
Re: FileMaker Pro, get image by reference
- Subject: Re: FileMaker Pro, get image by reference
- From: Gary Lists <email@hidden>
- Date: Sat, 23 Nov 2002 11:59:17 -0500
On 11/23/02 11:08 AM, Pieter van Helvoirt wrote:
>
I want to use FileMaker Pro as a image-database using a thumbnail and
>
the assets reference. This works well since it's one of the new
>
features in version 6.
This has been possible since the Open URL osax, and similar. I know the URL
reference is a new built-in to FM6, but it is certainly not a "new" thing.
>
But the asset reference is a URL!
>
>
My Problem:
<clipped>
>
I can't get it to work.
I do the same thing. Here is my applescript, which is just pasted as text
into the Script Text box that you get when you define the script step
"Perform AppleScript" (under Miscellaneous...still...in FM6 ! ;) in the
left-side script steps selector list.
Remember: an image inserted into a container field in FM, if it is inserted
as a REFERENCE to the file, instead of the actual file, will give back a
text string that is the path to the image when it was inserted.
So, the first line of this script sets the variable "as_file_reference" to
(cell "Image Lo Res")...which might seem odd, since you might think that
that cell has "an image". It doesn't, it only has a file path reference to
the image as a text string (NOT as a fully qualified file path alias.)
The second line of actual script code does that for us.
============== Gary's FileMaker image file copier =============
set as_file_reference to (cell "Image Lo Res" of current record)
-- its still just a text string, like "HD:Documents:Images:"
set as_file_path to as_file_reference as alias
-- now its a full mac file reference
--
tell application "Finder"
activate
try
copy file as_file_path to desktop -- * change dest folder here
on error errMsg number errNum
if errNum = -15267 then
display dialog "A copy is already on the desktop." buttons "OK"
[NO-BREAK-remove] with icon stop
else
display dialog "Oops.! Can not copy the file." & return & return &
[NO-BREAK-remove] errNum buttons "OK" with icon stop
end if
end try
end tell
==================================================
* This marks the spot where you can change the destination folder.
You can also pass this in dynamically, from a field on your database table.
Just add a line at the beginning like "set dest_folder to cell
"copyToThisFolder" of current record, then you will need to do the same
text->alias step as I do with "as_file_path", and then put that AS variable
name in place of the word 'desktop' below.
HTH, Pieter. Good luck.
Gary
--
Do not reply via email. Incoming replies are auto-deleted.
Please post directly to the list or newsgroup. Thank you!
Really need direct? Rot me at:
email@hidden
Lbhe fhowrpg zhfg ortva "abgwhax:" (ab dhbgrf)
Avpr gb zrrg lbh! Qba'g fcnz zr.
_______________________________________________
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.