Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6870 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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.

Posted

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???

Posted (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 by Guest
Posted

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.

Posted

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.

Posted

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

Posted

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.

Posted

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... ;)

Posted

Ahhh. I see. Sometimes its easy to over think things even tho when the answer is right in front of you.

Thanks again.

  • 2 weeks later...
Posted

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.

Variable.png

PDFname.png

  • 3 weeks later...
Posted

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
Posted

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
Posted

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

  • 2 months later...
Posted

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?

This topic is 6870 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.