I have updated my variable to be cross platform and also allow me to see if it works on a pc. A pdf is created on the pc, but it has no name..
On the table that I execute the script from, I can see my field with the correct data in - it is this field (INVOICE DETAILS::Reference) that shoud be the name of the pdf file..
Choose ( Abs ( Get ( SystemPlatform ) ) -1 ; Get ( DesktopPath ) & INVOICE DETAILS::Reference & ".pdf" ; "filewin:"& Get ( DesktopPath ) & INVOICE DETAILS::Reference & ".pdf" )
You might consider something like this:
Allow User Abort [Off]
Set Variable [ $filepath; Case ( Abs ( Get ( SystemPlatform )) = 1; "filemac:"; "filewin:" ) & Get ( TemporaryPath ) & "fm_file.pdf" ]
Export Field Contents [ container field; $filepath; Automatically open ]
check out this post:
The "filemac/filewin" tag is not needed so you don't have to test for system platforms.
Set Variable [ "file:" & Get ( DesktopPath ) & INVOICE DETAILS::Reference & ".PDF" ]
Should be all that you need. Make sure that your "Table occurrence context" is correct for referencing INvoice Details at the point in time where this script step executes.
You were right - it was a T.O. Issue. I thought the variable should contain fields from the table that I launcehd the script from and not the table that is used on the report that I am exporting...