Pagesender script

Ray Robertson at Scripting Matters suggested I post this here. He thought someone might offer me a simple script solution:

I need a very basic applescript that will automate sending faxes from FileMaker via PageSender. I have the FileMaker script, and only need a script that will paste the fax number (copied from a field in FileMaker) into the “Fax number” section of PageSender, and then essentially press the “print” button.

FileMaker’s own scripting language automates printing without using a dialogue box.

Pagesender posts this AppleScript in its examples, but I don’t know which parts I need and which I don’t, and what file names I have to change, etc.

PageSender’s scripting info: http://www.smileonmymac.com/pagesender/help/pagesender.html

The script they offer:

global varPhoneValue
global varNameValue

tell application “FileMaker Pro”
if (version as text < “7”) then
set theDoc to document “Filemaker Pro Example.fp5”
else
set theDoc to item 1 of (documents whose name starts with “Filemaker Pro Example”)
end if
set varPhoneValue to cell “Fax Number” of current record of layout “Data Entry” of theDoc
set varNameValue to cell “Name” of current record of layout “Data Entry” of theDoc

end tell

tell application “Page Sender Fax Center”
set thePreset to make new preset at beginning of every preset
tell thePreset
set application name to “FileMaker Pro”
set theFaxInfo to make new fax info at beginning of every fax info
tell theFaxInfo
set regarding to “Invoice”
set schedule at to “now”
end tell
set theFaxNumber to make new fax recipient at beginning of every recipient
tell theFaxNumber
set phone number to varPhoneValue
set name to varNameValue
set country code to “1”
end tell
end tell
– Save the preset file
save thePreset
– Remove the preset from memory (avoid leaks)
delete thePreset
end tell