Re: FileMaker 7 Container Fields
Re: FileMaker 7 Container Fields
- Subject: Re: FileMaker 7 Container Fields
- From: Malcolm Fitzgerald <email@hidden>
- Date: Wed, 23 Mar 2005 10:01:41 +1100
On 22/03/2005, at 7:22 AM, Bruce Robertson wrote:
Hello Everyone,
I have seen scripts such as the one below for inserting JPEGS into
FileMaker
6 container fields. Can any file type be inserted in a similar manner?
FileMaker 7 Container fields can now hold any file type so it would
be nice
if I could use a similar technique with files like word docs, etc.
In short is there a way to read ANY file of the disk into Applescript
and
then set it into a Container Field in FileMaker 7
Thanks for all your help.
Todd
--Script that works in 6 for images
set myJPEGFile to choose file
set myRef to open for access myJPEGFile
set myImage to read myRef as "JPEG"
close access myRef
tell application "FileMaker Pro"
tell database 1
tell record 1
set cell "Image" to myImage -- "Image" is a
container field
end tell
end tell
end tell
First of all your script can be simplified:
set myImage to read (choose file) as "JPEG"
I'm sure "JPEG" is not going to change but you may prefer to use the
class name: JPEG picture, GIF picture, TIFF picture, picture.
set myImage to read (choose file) as JPEG picture
If you want to use a file reference, then it is easy enough but I do
hope we
can figure out how to set the value of a container field NOT as a
reference
and I don't know how to do this either yet.
The short answer to your question is "NO". Filemaker's applescript
implementation cannot handle all file types. I'm sure this is a bug
because it's easy to do manually. You may find a workaround for your
current needs if you can go via the clipboard. This is really
unsatisactory but the FMP applescript reference has been saying "use
the clipboard" forever and it hasn't changed in v7.
A glimmer of hope, however, is that FMP's applescript implementation
will accept PICT data. So, if you can transform your JPEG data to PICT
you'll be able to store the image.
Malcolm Fitzgerald ph: 02 93180877
Database Manager fax: 02 93180530
The Australian Society of Authors www.asauthors.org
_______________________________________________
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