Re: Set value of FileMaker container?
Re: Set value of FileMaker container?
- Subject: Re: Set value of FileMaker container?
- From: Paul Scandariato <email@hidden>
- Date: Tue, 19 Mar 2002 18:01:18 -0500
on 3/19/2002 9:47 AM, Kai Edwards <email@hidden> wrote:
>
I don't know if ehsan (who disseminates very sound FMP advice) can give you
>
a few pointers here, Paul.
>
>
Anyhow, in case you don't get any better tips, here's a workaround that
>
might help...
>
>
I tried extracting the raw data from an EPS file, but FileMaker didn't
>
really appreciate that! However, it occurred to me that FMP has access to a
>
bunch of translators that might be press-ganged into service - with a little
>
persuasion. (Hopefully "Barcode Producer" can create Mac EPS files, since
>
these seem to be the flavour that FMP finds easiest to digest.)
Hello Kai,
From what I can tell after several hours of testing, FMP simply doesn't like
having the EPS files from Barcode Producer passed over via AppleScript. I
instead tried this, which seems to work at a base level:
tell application "FileMaker Pro"
set n to get data cell "number" of current record
end tell
tell application "Barcode Producer"
-- exports a TIFF file instead
set barcode to ISBN n as TIFF resolution 600
end tell
tell application "FileMaker Pro"
set cell "barcode" of current record to file (barcode)
end tell
Even without using Barcode Producer, I was unable to pull in an EPS where a
regular TIFF file worked flawlessly. I'll need to do more checking to see if
it's related to the EPS itself, or if its a general FileMaker problem. I'd
imagine the latter is the case, since I can insert a Barcode Producer EPS
using a FMP script without any problems at all, which is why the following
works as well.
I believe FileMaker is using QuickTime for reading TIFF files, though it's
hard to be sure.
<snip>
>
---------------------------------------------------------------
>
FileMaker preparation
>
---------------------------------------------------------------
>
>
1) Create a new script called something like "import barcode"
>
2) In the new script, define the following commands:
>
>
Go to Field ["barcode"] -- required for import
>
Import Picture ["barcode.eps"] -- the file in "Stage2"
>
Go to Field [] -- unspecified (to deselect field)
>
>
---------------------------------------------------------------
>
AppleScript
>
---------------------------------------------------------------
>
>
property stage1 : alias "Macintosh HD:FMP Imports:Stage1:"
>
property stage2 : alias "Macintosh HD:FMP Imports:Stage2:"
>
property fileName : "barcode.eps"
>
>
tell application "FileMaker Pro"
>
set n to get cell "number" of current record
>
end tell
>
>
tell application "Barcode Producer" -- untested by me!
>
set barcode to ISBN n -- returns a path to EPS file
>
end tell
>
>
tell application "Finder"
>
set theCopy to duplicate barcode to stage1 -- [1]
>
set name of theCopy to fileName
>
move alias ((stage1 as string) & fileName) to stage2 replacing yes
>
empty trash -- optional
>
end tell
>
>
tell application "FileMaker Pro"
>
do script "import barcode"
>
end tell
This is just the concept I needed to get it going -- I was able to simplify
your script further using Barcode Producer's own 'target' property:
tell application "FileMaker Pro"
set n to get cell "number" of current record
end tell
tell application "Barcode Producer"
set barcode to Code39 n ,
target "Macintosh HD:FMP Imports:Stage2:barcode.eps"
-- replaces existing file
end tell
tell application "FileMaker Pro"
do script "import barcode" -- goes right to Stage2:barcode.eps
end tell
>
---------------------------------------------------------------
>
[1] Depending on the path defined by "Barcode Producer", you may need to
>
coerce 'barcode' to an alias - using something like '(barcode as alias)'.
Right now, it returns a file path as a string, which can be easily converted
to a file reference by using "file (barcodepath)".
>
BTW, I originally tried using an alias file of the EPS instead of
>
duplicating it - which promised to be a bit faster. But FileMaker
>
immediately tracked down the original item (which I suppose is logical for
>
an import command) - and thereafter imported the same file every time! (Ah
>
well...)
Is it perhaps possible to use AS to send a FMP script a parameter? This
would allow the above script to operate (provided it created the folders)
without any configuration on another machine. The overall intention is to
allow others to configure this on their own machines without much trouble.
It always seems to complicates things with AppleScript when you have to
ensure it works everywhere...
BTW, Barcode Producer is my application (should have mentioned that
earlier), for which I'm currently adding AppleScript support for, along with
a bunch of FileMaker examples. I've had no problem with the technical end of
making it scriptable, my real trouble is usually figuring out the logic
behind the dictionaries for other scriptable applications like FileMaker --
which is why I asked here, as oppose to the AppleScript developers list.
Thanks very much for the help!
- Paul
--
Paul Scandariato
Intelli Innovations, Inc.
Phone: (919) 468-0340
E-mail: email@hidden
http://www.intellisw.com/
I have never let my schooling
interfere with my education.
- Mark Twain
_______________________________________________
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.