AnsweredAssumed Answered

Showing ERROR #3 when executing Insert PDF Script Step

Question asked by Guy_Smith on Jul 31, 2012
Latest reply on Aug 1, 2012 by Guy_Smith

I thought I had my script to place a pdf copy of a report into an archive Table in FMP 12 up and running, but cannot get past an Error #3 ("Command is Unavailable (for example, wrong OS, wrong mode, etc.") when I reach the Insert PDF script step.

 

The script works correctly up to that point, printing the original report and saving a copy to the Desktop (which I will turn into a Temp Filepath once I get this bug worked out) with a proper file name (no spaces, colons, or slashes), goes into the Report Archive TO, creates the new record, goes to the right field, and then gives me the error when executing the Insert PDF step. The field is a container field with no special attributes.

 

Here is the Script:

 

Go to Layout [ “WeeklyReport” (People) ]

Enter Browse Mode

Sort Records [ Keep records in sorted order; Specified Sort Order: People::NameLast; ascending

People::NameFirst; ascending ]

[ Restore; No dialog ]

Print Setup [ Orientation: Landscape; Paper size: 8.5" x 11" ]

[ Restore; No dialog ]

Print [ Records being browsed; All Pages; Orientation: Landscape; Paper size: 8.5" x 11" ]

[ Restore: HP Color LaserJet 1600; No dialog ]

Set Variable [ $ReportFileName; Value:Let ( [

tempName = Get(LayoutName) & "_" & GetAsText ( Get(CurrentTimeStamp) ) ;

cleanName = Substitute ( tempName ; [" "; "_"] ; ["/"; "_"] ;[":";"_"])];

"file:" & Get (DesktopPath) & cleanName & ".pdf") ]

Save Records as PDF [ File Name: “$ReportFileName”; Records being browsed ]

[ Document - Compatibility: Acrobat 7 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 ]

Go to Layout [ “ReportArchive” (ReportArchive) ]

Enter Browse Mode

New Record/Request

Commit Records/Requests

Go to Field [ ReportArchive::Report ]

//

//Everything works fine up till the next step - Insert PDF. That is when I get an Error #3

//

Insert PDF [ “$ReportFileName” ]

Go to Layout [ “SplashPage” (NewDB_Master) ]

 

Hopefully it's something fairly simple, but the problem is just not jumping out at me.

 

Thanks for taking a look and please let me know if you have any ideas..

 

Guy

Outcomes