Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

calculating the name of a PDF export

Featured Replies

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?

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.

  • 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?

error.jpg

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

  • 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 ?

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 ).

  • 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.

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.

  • 2 months later...
  • 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.

  • 3 months later...
  • 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.

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

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.