dysong3 Posted March 9, 2012 Posted March 9, 2012 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?
imoree Posted March 9, 2012 Posted March 9, 2012 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. 1
dysong3 Posted March 10, 2012 Author Posted March 10, 2012 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?
imoree Posted March 10, 2012 Posted March 10, 2012 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
dysong3 Posted March 11, 2012 Author Posted March 11, 2012 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 ?
comment Posted March 11, 2012 Posted March 11, 2012 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 ).
dysong3 Posted March 11, 2012 Author Posted March 11, 2012 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.
comment Posted March 11, 2012 Posted March 11, 2012 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.
dysong3 Posted June 8, 2012 Author Posted June 8, 2012 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.
dysong3 Posted October 2, 2012 Author Posted October 2, 2012 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.
comment Posted October 2, 2012 Posted October 2, 2012 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
Recommended Posts
This topic is 4434 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now