Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

DaveGoff

macrumors newbie
Original poster
Feb 19, 2008
2
0
Hello,

I have a Filemaker app that I have been working on and I want my report script to export the report as a pdf with the name of the file determined by a field.

It seems that I had done this long ago by having Filemaker copy the field contents to the clipboard, then had Applescript paste the clipboard into the name of the appropriate file.

I can't seem to see how to "paste" anything in Applescript now. Is the an easier way to do this?

DaveGoff

My webcomic - Alienses - It's kind of like Cheers meets the X-Files!
http://www.alienses.smackjeeves.com
 

lancestraz

macrumors 6502a
Nov 27, 2005
898
0
RI
Why not copy the fields content directly to a variable?
Code:
set fieldContent to the content of field thisOne
Or whatever the syntax for FileMaker is.

Then rename it.
Code:
tell application "Finder"
	set name of ("Macintosh HD:Report.pdf" as alias) to (fieldContent & ".pdf")
end tell
 

DaveGoff

macrumors newbie
Original poster
Feb 19, 2008
2
0
Turns out my thinking was just all wrong. :eek: No need for Applescript at all Filemaker scripting can handle the whole thing.

These two steps took care of the problem

Set Variable [$path; Value:"file:" & Get ( DesktopPath ) & "Reports/" & FilenameField & ".pdf"
Save Records as PDF [Restore; No Dialog; "$path"; Records being browsed]

Thanks for the help though!


DaveGoff

My webcomic - Alienses - It's kind of like Cheers meets the X-Files!
http://www.alienses.smackjeeves.com
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.