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

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

Recommended Posts

Posted

My goal is to Save As PDF to a new folder on the user's Desktop which I name(!) using a record ID, and this must work x-plat. I will be exporting additionally pdfs to this folder for a grand total of about 5 pdfs.

I'm aware of JMO's export of a zipped folder, but that does not let me name the folder dynamically (and will in fact overwrite the folder if it exists).

I need a MakeDir function in FM (if only FTPeek's plugin worked on local directories, Jesse!), and I was hoping for a technique rather than using Troi (unless that's run on the server, we're trying to push all plug-in dependencies to server scripts).

Many thanks to any and all ideas or empathy.

Posted

You should be able to use the ScriptMaster plugin for the purpose; it has a create directory example and is cross platform.

Alternately you can have the script execute different logic for Windows/Mac, for Windows a send event to execute a DOS mkdir command would do the trick, whereas on Mac you'd tell Finder to create a new folder (sorry I'm a bit vague on latter; it's been a few years since I ran Macs).

Posted

Macs also have the mkdir command (showing common Unix heritage). Using a Perform AppleScript step, it would look like this:


set DT to POSIX path of (path to desktop)

set notes_folder to DT & "MorningNews/"



do shell script "mkdir -p " & notes_folder



-- p option creates subdirectories as needed, and suppresses an error if the folder already exists (it will not overwrite a folder)

P.S. If the folder name has a space, you'd want to use:

set notes_folder to quoted form of (DT & "MorningNews/")

Posted (edited)

I have no AppleScript experience, Fenton. I don't follow what you're saying at all, lol. Can you post a FM file that creates a folder on the desktop using Applescript, and that has the folder name equal to "MyFolder" & RecID? Maybe that'll give me a clue.

PS: I feel unworthy of my iMac.

PPS: I did work for an Apple Dealership for 10 yrs. and have the original rainbow logo mug to prove it!

Edited by Guest
Posted

Here's an example file which creates a folder on your Desktop, using a folder name from a FileMaker field. I included both the "vanilla" AppleScript method and the AppleScript "do shell script" (using Unix command line) method. The hardest part is getting the quotes right in the FileMaker calculations. Alternatively you could just get the value from the field at runtime.

The shell command is much shorter. It also has the advantage that it can create a hierarchy of nested folders, in several different ways. It can also get the user's desktop more easily, ie., "~/desktop"

But it has the disadvantage that you have to know how to quote text with spaces.

There is also a script to Export PDF (of itself) to that folder on the Desktop, creating it if needed.

Folder_from_field.fp7.zip

Posted

Got it. Terrific. Hope I can return the favor.

btw. I found this site, and right after I learn PHP, I'll learn AS.

I also downloaded ScriptMaster. I should probably go that route because if I can use Matt's technique of combining PDFs using iText and ScriptMaster, then I can output one PDF to a folder on their desktop with watermarks, etc. Even if I don't combine the PDFs, it is x-plat and will allow me to do this as a server script.

  • 3 months later...
  • 7 months later...
Posted

This is a great solution.

I kind of get it - but I dont want to create new folders on my desktop I would like to create them on my idrive....and I cant work out how I need to the set the switches and paramaters

Posted

I'm not sure what iDrive is (iDisk?). But it is fairly easy to modify the path to work on a mounted drive. I'll use the Unix example, as it's shortest and easiest. All mounted drives are in the hidden /Volumes/ directory, at the root of the startup drive. So, if the name of the drive is "Donuts", the path is: /Volumes/Donuts/

So, if my iDisk is named "Donuts", the AppleScript command would be:

do shell script "mkdir -p /Volumes/Donuts/Public/" & quoted form of "folder name"

That would create a folder "folder name" in my Public folder on my mounted iDisk.

You just have to (carefully) modify the(a) FileMaker calculation, to produce the above (for your path).

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