I am looking to create PDF out of my filemaker db. But I would like to automate it using applescript. If someone could share some info with me I need to know how to save a postscript file to a target folder on my desktop. Or if there is snippet available to look at on how to save .ps file in filemaker. Any help will do
Sorry Icecold, my last post on this could have been more explanatory.
You can’t use Applescript to print to Postscript, but you can use FileMaker’s scripting to do what you are looking to do, then call the FM script by using the “do script” command from Applescript.
First, in ScriptMaker, make a new script named Print PS and set up the following script steps:
Then, manually print your Postscript file, using all the settings you desire - Postscript or EPS, include fonts or not, and choose where the file is saved. Actually go through with the print to file process - you can delete the resulting file later.
Go back to ScriptMaker and edit your Print PS script…
Click on the script step “Page Setup”
Uncheck, the option “Restore”, then check it again.
Click OK to save the script. It will ask you if you want to Keep or Replace the Print Setup information - choose “Replace” so it will retain your page setup settings.
If you run the script “Print PS”, you’ll get a PS file saved in the folder of your choice without any dialogs. From here, you can have Applescript rename, or move this file, or leave it where it is.
If you want to have FMPro print a PS file, but want to do it from Applescript, you can do the following:
tell application "FileMaker Pro"
activate
do script "Print PS"
end
Hope this helps,
I did everything you said made my script in filemaker ran a manual print file to a destination folder. Then went back to my script unchecked the restore box and then rechecked it and did the replace of page setup. But it didn’t work. My ps file doesn’t save to the destination folder it goes directly to print and prints at the printer. What I noticed is page setup lets you select the paper size and the printer it is going to. Then Print is where you get to select if you want it to go to a printer or save it as a file. That means filemaker only restores the page setup. And not the print output
2nd Question is there a way to Store only a ref. to the file when it is imported into my cell
set SourceFolder to (Choose folder with Prompt)
tell application "Finder" to set filelist to (get the name of every file of folder SourceFolder) as list
set thispath to (SourceFolder as string) & thisFileName as string
tell Application "Filemaker Pro"
go to layout "Test"
set cell "myrtest" of current record to file thispath --Store only a ref. to the file Here--
do script "Print PS"
End tell
Correct, I’m sorry, in order to save your print settings you’ll have to do your manual print to the destination folder, then go back and edit your script. Click on the “Print” step, uncheck “without dialog”, then recheck it to retain print settings. Sorry for any confusion.
I have this set up in a working DB on my station where each of 3 separate scripts prints to separate PS files in different folders, as well as another script for sending to a printer.
I think so, and I am basing the assumption on this fact.
If I insert a graphic into a container without checking “store only a reference”, then get the cellValue of that cell, it is returned as <
If I insert a graphic into that same container but this time check “store only a reference”, then get the cellValue of that cell, it is returned as "file “Mac HD:Desktop Folder:somefile.jpg”
That would only lead me to believe that you are already setting the field to store only a reference to the file - ““set cell “myrtest” of current record to file thispath””
Get the cellValue of this cell after setting it via your applescript. Then, manually set the field to the same graphic, and do not check “store only a reference”. Then get the cellValue again to see what it is - is it different?
Can anyone back me up on this?
Best,
For some reason I am having problems with this I can’t get it to save the ps file in a folder it just goes directly to the printer on default.
Then if I choose my postscript printer it saves the ps file but not in to a folder just all over my desktop. I would like them neatly in one folder instead of scattered all over the desktop
This is kind of what I want to do a little bit more of an explanation would be really appreciated. I know we are on the right track but not quite there yet.
I nosed around FileMakerworld.com’s forums and didn’t see anyone with a similar problem. This is more of a FileMaker issue than an Applescript issue, perhaps Chopper, or someone else over there can help.
Nothing really special about my database, I set up the following script:
page setup / restore / no dialogs
print / no dialog
Then, I print to file, changing all the print and page setup settings and choosing my destination folder and finally printing to file.
Then, I go back to my script, uncheck restore, and no dialogs in all places in the script, then recheck them. Then close the script and when asked if I want to keep or replace settings I replace.
And, when I run that script - it does exactly what I told it to do - prints a PS file to the folder I designated. I am running FMPro 5.0v3 under Mac OS 9.2.1 using Desktop Printing.