slbr549 Posted September 20, 2005 Posted September 20, 2005 I am trying to set a script variable to save a pdf file automatically. Here is the variable: $filename = Get(desktoppatth)& "Filename.pdf" The first problem I have is that instead of c:... all the are /. So, I created a field to substitute the / with . This seems to work. However, get the following error on my windows xp machine. "Documents and SettingsslmaccheDesktopFilename.pdf" could not be created on this disk.Use a different name, etc.... I believe it is taking the $filname and feeding it with the quotes, but I'm not sure. I put in a show dialog to show what the variable is passing, and it is passing the correct C:Documents and SettingsslmaccheDesktopSpecifications.pdf. Any ideas? Thank you very much.
kiwiora Posted September 21, 2005 Posted September 21, 2005 I had the same problem - try this: """ & Middle(Substitute (Get(DesktopPath) ; "/" ;"");2;Length(Get(DesktopPath))) & "specifications.pdf" & """ I then use the "send event" to open the file as above. Strangely, Filemaker said that the at the start of the file was expected and not a bug???
CyborgSam Posted September 21, 2005 Posted September 21, 2005 (edited) FileMaker uses the [color:blue] (backslash) as an escape character within text strings in the calculation dialog. To insert a [color:blue]" (double-quote) into a text string, insert [color:green]". To insert a [color:blue] (backslash), insert [color:green]. To insert a [color:blue]¶ (paragraph mark), insert [color:green]¶. The paragraph mark's character may not show properly in all web browsers... Examples as they appear in a calculation: To get the text [color:red]"This is a quote." enter it as [color:green]""This is a quote."" To get the text [color:red]c:Documents and SettingsmeDesktop enter it as [color:green]"c:Documents and SettingsmeDesktop" To get the text: [color:red]This text is on two lines. enter it as [color:green]"This text is¶on two lines." Edited September 21, 2005 by Guest
slbr549 Posted September 26, 2005 Author Posted September 26, 2005 Thanks for the advice. I must still be doing something wrong as I am getting the same error. I'm not using a send event as I don't want to open the file, I just want to email it. I don't have to do anything funky for the mac side as the get(desktoppath) works fine there. It's only on the windows side that I have trouble. Any other suggestions? Thanks.
DG Posted September 26, 2005 Posted September 26, 2005 Just to knock the obvious on the head so to speak, is the folder you are trying to save to Read Only? I believe XP sometimes defaults to this when new folders are created. Just a thought.
slbr549 Posted September 27, 2005 Author Posted September 27, 2005 Yes, the folders are readable,but it still doesn't work. Thanks.
CyborgSam Posted September 27, 2005 Posted September 27, 2005 kiwiora's tip worked for me to give the correct path. What specifically is not working? Can you show us the actual code?
slbr549 Posted September 28, 2005 Author Posted September 28, 2005 Here is the code and the error messages that I am getting. Sample_Code_for_PDF_script.pdf
J Posted September 29, 2005 Posted September 29, 2005 I am a newbie to FM from Lotus approach. Can you go through the entire process of naming a pdf? I have the page with the graphics, I even have the button to create the pdf. Now I just need to name that pdf with a combination of fields from 2 different tables and with the date. OrgName TempName and current date 09-29-2005 Sample name would be. FloridaStateUPlat09-29-2005.pdf Thank you. Jason
mr_vodka Posted September 30, 2005 Posted September 30, 2005 Has anyone been able to successfully save or export with a variable path yet? I am also getting the same error. I'm on a XP box.
CyborgSam Posted September 30, 2005 Posted September 30, 2005 Got it: $filename = "filewin:" & Get ( DesktopPath ) & "specifications.pdf" The trick was to read the dialog box put up by the Save Records as PDF script step. Right in front of our eyes and we missed it... I blame old age... ;)
mr_vodka Posted September 30, 2005 Posted September 30, 2005 Ahhh. I see. Sometimes its easy to over think things even tho when the answer is right in front of you. Thanks again.
slbr549 Posted October 1, 2005 Author Posted October 1, 2005 Thanks so much. Works like a charm. I played with the filewin before, but I had it in the wrong place. Thanks again.
mav Posted October 10, 2005 Posted October 10, 2005 Newbie, Here's how I found to name a PDF file Two step script, first define the script variable, second call the variable for your file name. I've attached the png screen grabs for the mac, let me know if you need a PC friendly fm file. Darrin.
J Posted October 28, 2005 Posted October 28, 2005 Can you attach a pc friendly file or example on how to name the pdf's?
Fenton Posted October 28, 2005 Posted October 28, 2005 I don't think there's a whole lot of difference in the "name of the file", other than to not put reserved characters of that platform. Look at the dialog screenshots in mav's post. It shows examples of the file paths at the bottom. There is a difference in the prefix. If you're exporting to (or below) the desktop the easiest thing is to use the new: Get ( DesktopPath ) function. I put the entire file path together as a calculation, in a script Variable, then just put that as the path. Set Variable [ "$PDF_file"; Case ( Get ( SystemPlatform ) = -1; "filemac:": "filewin:" ) & Get ( DesktopPath ) & FileName & ".pdf" ] Then in the Export dialog's path, only: $PDF_file
Newbies DFS Posted November 3, 2005 Newbies Posted November 3, 2005 Pardon my ignorance, but what started as a eureka moment when I first read this post - a few hours down the track I am no closer to understanding the solution. I am using Windows XP and I have tried to set the variable as per mav's explanation, but when I specify the output file as: file:../Test Submission/$filename What I get as my file name is: $filename. My expected result is: SUB0004 031105.PDF Thanks David
Newbies DFS Posted November 3, 2005 Newbies Posted November 3, 2005 Ok, 6 hours later and I finally got it. It was a combination of all the solutions but the kicker was filewin:$PDFFile as opposed to the million other variations that I tried previously. What a great learning curve Thanks
mcyrulik Posted February 1, 2006 Posted February 1, 2006 If I have two file references in the Save records as PDf step 1) filewin:$filename 2) filemac:$filename will filemaker skip over the filewin reference on a mac or will it try that first, then move on the the filemac step?
Recommended Posts
This topic is 7131 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