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.

Save PDF on FM Server - through Applescript?

Featured Replies

Does anyone know of a solution yet to create a PDF as part of a server scheduled script?

I'm trying to send out an automatic traffic report in PDF format. All is compatible, I'm just not sure how to save my found set as a PDF when running without client FM.

Any input much appreciated!

Edited by Guest

Hi I recently did something similar by using the get (temporary path) function, I saved my Pdfs there and inserted them into a container field ready to be emailed. Not sure if thats what you mean though.

  • Author

That's a start, but it doesn't solve the problem of creating a PDF. If you turn on compatibility info for server in script editor, you will see that the "Save as PDF" step is grey - not compatible. I'm wondering if someone found a work around to creating a PDF on the server?

You could set up a robot machine...

  • Author

Sounds intriguing, can you tell me more about it?

  • Author

Ah, you mean run an FMP client on the server as well?

What I'm missing then is the possibility to run the script at a certain time each (week)day.

It seems it's either having a scheduled server script, or a PDF... or am I missing something?

Basically you can use a dedicate client Pro version to run the script. You can have a local file on that machine scheduled to open at a certain time. That file would then run a script that references the data files on your server. After it creates the PDF, it would then exit the application.

  • Author

I see, very interesting. That would have to be a system level script, I'm assuming?

Not necessarily..

Windows - a Scheduled event, repeating when you need

Mac - a Cron entry with similar details

  • Author

I do feel a bit like a moron... I really don't know much about system level scripting. Here's what I've tried:

open '/Volumes/Macintosh HD/Sample.pdf'

I saved this in a text-only file and had FM Server open it as a System level script. The response was "OK", but no file was opened. The file does exist in said location...

http://filemaker.custhelp.com/cgi-bin/filemaker.cfg/php/enduser/std_adp.php?p_faqid=5496&p_created=1128546566

Edited by Guest

  • Author

I've also just tried it with an AppleScript:

tell application "Finder"

activate

open document file "Sample.pdf" of startup disk

end tell

Same result, FM Server says that the script execution is ok, but nothing happens (the document is not opened)

Any ideas?

How about using an OnTimer script? Start it in an Open Script if get (accountname) = "Robot".

  • Author

True, I could do that. I mean to be picky, but I do feel that a server script would be much more robust. What if someone accidentally closes the file?

But if I can find out how to get an AppleScript started via server, I will go with your suggestion.

you are right: a server side script would be more robust, but some features are simply not supported server-side.

So setting an FMP client robot machine is your easiest solution.

To solve the issue of somone closing the file: take away keyboard and mouse so that you can only get to it remotely.

Use whatever OS tools there are to schedule an OS-level script that would:

- launch FM

- open the hosted file

- run an FM script routine

- close the file

- close FM

So in between runs there would be nothing to go wrong or accidentally close.

Remember that FM on Mac has extensive Applescript support and on Windows there is the ActiveX interface to talk to FM from the outside.

If you have specific questions on OS-level scripts there are dedicated sections in FMforums on that...

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.