AnsweredAssumed Answered

Evaluate and get the value of local or global variable inside of a script

Question asked by czachariou on Sep 18, 2017
Latest reply on Sep 18, 2017 by jurgmay

I have a FileMaker Pro 15 script that goes through each record of FileMaker Pro 15 database. The steps is get the PDF file from a container field and copy the PDF file into a temporary folder. Run a GhostScript script to produde the 1st page image file into that same temporary folder as a "1.png" file. Then copy the image file content to another container field in the same database as an image and delete the physical image file "1.png" and the PDF file from the temporary folder. Move onto the next record.

Problem: Can not get the value of a $variable into the Send Event, not even if I try to use a $variable in another Set Variable and then use the new Set Variable variable in the Send Event function.

Example: If I run it as follows:

cmd /c timeout /t 1 /nobreak & "c:\Applications\Document Apps\GhostScript\gs9.21\bin\gswin64c.exe" -dBATCH -dNOPAUSE -sDEVICE=png16m -dGraphicsAlphaBits=4 -dTextAlphaBits=4 -r150 -dFirstPage=1 -dLastPage=1 -sOutputFile="d:\Temp\FileMaker-Temp\%d.png" "d:\Temp\FileMaker-Temp\ApprovedProviderList.ProviderInfo.pdf"

It works because the values are fixed. However if I try to run in as:

cmd /c timeout /t 1 /nobreak & "c:\Applications\Document Apps\GhostScript\gs9.21\bin\gswin64c.exe" -dBATCH -dNOPAUSE -sDEVICE=png16m -dGraphicsAlphaBits=4 -dTextAlphaBits=4 -r150 -dFirstPage=1 -dLastPage=1 -sOutputFile="d:\Temp\FileMaker-Temp\%d.png\" " & Quote ( $FilePathWindows )

It does not work. The $FilePathWindows value consisting of the path and filename ("d:\Temp\FileMaker-Temp\ApprovedProviderList.ProviderInfo.pdf") set earlier in the my script from a Set Variable is not evaluated and returned before the current Set Variable $variable is set.

How can I get this to work?

Outcomes