September 20, 200520 yr 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.
September 21, 200520 yr 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???
September 21, 200520 yr 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, 200520 yr by Guest
September 26, 200520 yr Author 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.
September 26, 200520 yr 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.
September 27, 200520 yr kiwiora's tip worked for me to give the correct path. What specifically is not working? Can you show us the actual code?
September 28, 200520 yr Author Here is the code and the error messages that I am getting. Sample_Code_for_PDF_script.pdf
September 29, 200520 yr 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
September 30, 200520 yr 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.
September 30, 200520 yr 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... ;)
September 30, 200520 yr Ahhh. I see. Sometimes its easy to over think things even tho when the answer is right in front of you. Thanks again.
October 1, 200520 yr Author Thanks so much. Works like a charm. I played with the filewin before, but I had it in the wrong place. Thanks again.
October 10, 200520 yr 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.
October 28, 200520 yr 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
November 3, 200520 yr Newbies 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
November 3, 200520 yr Newbies 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
February 1, 200619 yr 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?
Create an account or sign in to comment