March 9, 201213 yr As far as I can tell, the "export as PDF" script step does not let you give a calculated name to the resulting file. Would any one have a work around or a brilliant idea for doing this?
March 9, 201213 yr Set Variable [$FilePath ; Value: "file:" & Get ( DesktopPath ) & Substitute ( Get ( CurrentDate) ; "/" ; "-" ) & ".PDF" This example saves to the desktop. You can use an explicity file path or a different Get function to save it to any number of other locations.
March 10, 201213 yr Author Thanks a lot imoree. But I when I use your calculation to specify out file and path in the "save record as PDF" script step, I get this message when the disk is not locked or lacking space. Any idea what I might be doing wrong?
March 10, 201213 yr Try this Create a new script with these options" Set Variable [ $filePath; Value:"file:" & Get ( DesktopPath ) & Substitute ( Get ( CurrentDate) ; "/" ; "-" ) & ".PDF" ] Save Records as PDF [ File Name: “$filePath”; Records being browsed ] Hope that helps. -i
March 11, 201213 yr Author Great. Thank you so much. I finally understood what I was doing wrong. I was putting "file : $filePath" and not just "$filePath" in the output path. Now another related question. I have a folder that is mirrored on two computers where I keep all my important documents. But obviously the path to that folder is only partially identical on both computers as follows : file://localhost/Volumes/Macintosh%20HD/Users/xxxxx/Documents/Krakatoa/Le%20Petit%20Globe/contrats/2012 and file://localhost/Volumes/Clint/Users/yyyyy/Documents/Krakatoa/Le%20Petit%20Globe/contrats/2012 Is there a way of indicating in a calculation that the document can be saved to one or other of these two destinations ? So in the above calculation instead of Get ( DesktopPath ) what would you put? Or is this not possible ?
March 11, 201213 yr How about something like = Case ( Get ( SystemDrive ) = "/MacintoshHD/" ; "file://localhost/Volumes/Macintosh%20HD/Users/xxxxx/" ; Get ( SystemDrive ) = "/Clint/" ; "file://localhost/Volumes/Clint/Users/yyyyy/" ) & "Documents/Krakatoa/Le%20Petit%20Globe/contrats/2012" There are other Get() function that can help you determine the current system, e.g. Get ( SystemNICAddress ).
March 11, 201213 yr Author Still can't quite get this to work. The value I have put in the variable calculation is : "file:" & Case ( Get ( SystemDrive ) = "/MacintoshHD/" ; "file://localhost/Volumes/Macintosh%20HD/Users/xxxxx/" ; Get ( SystemDrive ) = "/Clint/" ; "file://localhost/Volumes/Clint/Users/yyyyy/" ) & "Documents/Krakatoa/Le%20Petit%20Globe/contrats/2012" & Events::Summary & Substitute ( Get ( CurrentDate) ; "." ; "." ) & ".pdf" And I'm getting a similar error message to the one above. Something wrong with the syntax, but I can't figure out what.
March 11, 201213 yr Offhand, I see you have "file:" twice. --- Hint: When you get an error message of the type you have posted earlier, check the contents of the $variable - either in the data viewer or by a custom dialog. Then you can see how it differs from the path you need.
June 8, 201213 yr Author finally figured out why this wasn't working. Instead of Case ( Get ( SystemDrive ) = "/MacintoshHD/" ; "file://localhost/Volumes/Macintosh%20HD/Users/xxxxx/" ; Get ( SystemDrive ) = "/Clint/" ; "file://localhost/Volumes/Clint/Users/yyyyy/" ) & "Documents/Krakatoa/Le%20Petit%20Globe/contrats/2012" & Events::Summary & Substitute ( Get ( CurrentDate) ; "." ; "." ) & ".pdf" I used Case ( Get ( SystemDrive ) = "/MacintoshHD/" ; "file:/Macintosh%20HD/Users/xxxxx/" ; Get ( SystemDrive ) = "/Clint/" ; "file:/Clint/Users/yyyyy/" ) & "Documents/Krakatoa/Le%20Petit%20Globe/contrats/2012" & Events::Summary & Substitute ( Get ( CurrentDate) ; "." ; "." ) & ".pdf" And that did the trick.
October 2, 201213 yr Author Actually I am finding this formula extremely temperamental. It works once or twice then stops, giving error messages. Does anyone know where you find rules on how to formulate the variable that can specify the name and destination folder so that it can be applied in the "save records as pdf" script step? Or maybe upload an example.
October 2, 201213 yr Does anyone know where you find rules on how to formulate the variable that can specify the name and destination folder so that it can be applied in the "save records as pdf" script step? http://www.filemaker.com/12help/html/create_db.8.39.html#1030283
Create an account or sign in to comment