AnsweredAssumed Answered

Trying to use Pagesender to Fax a record to clients.

Question asked by michaelpowers on Oct 30, 2009
Latest reply on Oct 30, 2009 by michaelpowers

Title

Trying to use Pagesender to Fax a record to clients.

Post

Pagesender has an example of Filemaker faxing an invoice. I can use their solution and it works (mostly). I am trying to install the scripts in my solution and have not been able to get it to work. It uses three scripts which I have printed out below. I get several error messages when it runs. The first of which is "" could not be created on this disk. Use a different disk, unlock it or use a different disk. I believe that this script prints a PDF to the pagesender folder to later be sent. I believe that the PDF is the file that cannot be created. Can you give me a direction to go in?

 

 

 

Fax Flyer 

Perform Script [ “get pagesender data folder path” ] 

Set Variable [ $$pageSenderFile; Value:"/*\"filemac:\" & LCSW Solution::pagesender Folder & \"/FMProExport.pdf\"*/" ] 

Show All Records 

If [ Get(FoundCount) = 0 ] 

Exit Script [  ] 

End If 

Go to Record/Request/Page 

[ First ] 

Go to Layout [ “Fax Flyer” (LCSW Solution) ] 

Loop 

Save Records as PDF [ File Name: “$$pagesenderFile”; Current record ] 

[ Document -  Compatibility: Acrobat 5 and later ] 

[ Pages -  Number Pages From: 1; Include: All pages ] 

[ Security -  Printing: High Resolution; Editing: Any except extracting pages; Enable copying; Enable Screen Reader ] 

[ Initial View -  Show: Pages Panel and Page; Page Layout: Single Page; Magnification: 100% ] 

[ Restore; No dialog ] 

Perform Script [ “runCompiledFaxScript” ] 

Go to Record/Request/Page 

[ Next; Exit after last ] 

End Loop 

Go to Layout [ “Table” (LCSW Solution) ] 

 

runCompiledFaxScript 

Enter Browse Mode 

Set Error Capture [ On ] 

Perform AppleScript [ Native AppleScript: global varPhoneValue 

global varNameValue 

set libPath to path to library folder from user domain as text 

set hfsPath to libPath & "Page Sender:FMProExport.pdf" 

set pdfPath to POSIX path of hfsPath 

tell application "FileMaker Pro" 

if (version as text < "7") then 

set theDoc to document "LCSW Solution.fp5" 

else 

set theDoc to item 1 of (documents whose name starts with "LCSW Solution") 

end if 

set varPhoneValue to cell "Fax Number" of current record of layout "Table" of theDoc 

set varNameValue to cell "Name" of current record of layout "Table" of theDoc 

end tell 

tell application "PageSender Fax Center" 

set thePreset to make new preset at beginning of every preset 

tell thePreset 

set application name to "presets" 

set pdf path to pdfPath 

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 

set pdfPath to pdf path of thePreset 

-- Remove the preset from memory (avoid leaks) 

delete thePreset 

end tell 

set pdfFile to alias (POSIX file pdfPath as text) 

tell application "PageSender Helper" 

open {pdfFile} 

end tell 

 ] 

If [ Get(LastError) ≠ 0 ] 

#call any error handling routine from here 

Beep 

Show Custom Dialog [ Title: "Message"; Message: "exception while executing applescript"; Buttons: “OK” ] 

End If 

Set Error Capture [ Off ] 

 

get pagesender data folder path 

Perform AppleScript [ Native AppleScript: set libPath to (path to library folder from user domain as string) 

set startupDisk to path to startup disk as string 

set hfsPath to libPath & "Page Sender" 

set pagesenderPath to POSIX path of hfsPath 

if pagesenderPath does not start with "/Volumes" then 

set pagesenderPath to POSIX path of (startupDisk & hfsPath) 

else 

set pathLength to (length of pagesenderPath) 

set pagesenderPath to (characters 9 through pathLength of pagesenderPath) as string 

end if 

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 cell "pagesender Folder" of current record of layout "Config" of theDoc to pagesenderPath 

end tell 

 ] 

 

 

Outcomes