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

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

Recommended Posts

Posted

Can anyone give me the fastest simplest way to name a "save as PDF" file using a field from the current record? All paste, etc. features are greyed out, and scripting doesn't offer any options that I can find. Thanks for your help!!

Posted

Set a variable (say $_output) to the exact path and name where you want to save the PDF under.

(Keep in mind that FM expects the path to be in its own syntax, not the OS format)

Then in the "Save as PDF" script step, in the "specify output file" dialog, just enter the name of the variable: $_output

Posted

Thanks Wim Decorte;

I am having a issue with the path. My script will respond telling me that I must use a different name (the name is correct), to unlock the disk or save to a different disk. Everything I check seems to be fine. It runs, but just won't save the file...

Set Variable [$_output: Value"Erdelt HD/FactTagPDFs/" & LacksFactTag::SkuSort & ".pdf"]

Save Records as PDF [Restore; No dialog; "/$_output"; Current record]

The actual entry in the specify= filemac:/$_output

Any help?

Posted

You get that message when the path is incorrect, i.e., impossible to access. It looks OK to me though. I usually just put the "filemac:/" into the Variable, so I can check for platform (also so I can see it in Data Viewer; which I believe you need Advanced for). Look carefully at the names. Do you indeed have a folder "FactTagPDFs" at the top level of the drive, and is your hard drive (or mounted drive) named "Erdelt HD"? No slashes in the file name? etc..

There may be some error, but I don't see it.

Posted

The actual entry in the specify= filemac:/$_output

No, no...

In the specify output you can only have "$_output".

The "filemac:/" needs to be set in your variable.

The Specifiy Output File dialog is not a calculation window.

Posted

Thanks Everyone! but, I still have a path error. It names correctly, but still says that it can't save to the disk. What is the most generic path name that I can use? I tried [Get (DocumentsPath)], but no file???

If anyone has the time to look, I can try to email the script so you can see how it is set up.

Thanks again.

Posted

You might want to create an unstored calculation field, so you can see what the result is. A common glitch is that the functions like Get (DocumentsPath) return the starting slash. So you'll get an error if you use a calculation like "filemac:/" & Get (DocumentsPath) & "file.ext", because it ends up: filemac:// (2 slashes).

You could upload a clone of your file, and we can look for an error. But, because you've renamed your hard drive, your calculation will not work for anyone else.

Posted

One very important part of this that I forgot to include... I am accessing a remote database served with FMS7. What differences will that make on the naming path???

Paul

Posted

Well, the path is evaluated on the client. You would save the PDF onto the client machine. You'd be using FileMaker 8 on the client. So the fact that the file is hosted on FileMaker 7 I don't think would make a difference. 7 and 8 are the same file format, and it all happens on the client.

Posted

The two other obvious things to check are:

- does the path really exist?

- does the user have OS write rights to that folder?

  • 3 weeks later...
Posted

So if you want to save PDF files from clients that are running a solution off of a FM server you would need a script with a custom save path for each client?

Can't I just create some sort of generic path that dumps the file into the clients FM folder? The same way exporting files worked in FM5.

Posted

There are several Get() functions that can be used in a calculation to produce a client-specific file path:

Get ( DesktopPath )

Get ( DocumentsPath )

Get ( FileMakerPath )

These produce "FileMaker syntax" paths. The final calculation of the full path, with the correct prefix and the rest of the path, can be put into a script Variable. The Variable can then be used directly in any of the Export/Import steps.

There are several posts here with more specific instructions; but that's the gist of it. It is also explained in the FileMaker Help, though it may take a little jumping around to find it.

This topic is 6675 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.