Jump to content

Numpty advice re scriptmaster


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

Recommended Posts

Hi all,

I am an amateur FM user with trying to achieve something fairly simple. I have a DB of clients. When I add a new client, I want to create a folder on my Mac named with the client's ID number. 

I have Scriptmaster, I have registered the create folder function, which now shows up in my list of functions.

My problem is how to write the script to create the folder? Which script command would I use to deploy the function? Or am I missing something important?

thanks in advance

Pete

Link to comment
Share on other sites

Thanks so much. That has got rid of the syntax error. However the script seem to do anything, no error message.

Is the 'set variable' command enough? Or does it need anything else. According to Scriptmaster it will return 1 or 0 depending on whether the folder already exists (it doesn't). see pic.

P

script.tiff

sorry, attached now as jpeg

script.jpg

Link to comment
Share on other sites

Your parameter is missing a slash before Macintosh HD.

If you're using FileMaker 17, you don't actually need a plugin to create a folder. You can use Export Records with a found set of 0 records and Create Directories on. If you set the export to export to a file called say "dummy.txt", a folder will be created but no actual file, since there are no records to export. Use Set Error Capture [On] at the beginning of the script to avoid error messages.

Link to comment
Share on other sites

Thanks. I changed it to "/Macintosh HD...", but it returned an error. Then I used "filemac:/Macintosh HD...." and it returned 1, which means it was successfully created. But still no folder (anywhere on the hard drive).

I'm using FMP 12 Advanced. It might be time to upgrade...

Link to comment
Share on other sites

this won't work with a path that starts filemac:

It needs to be an O/S system path, and while I know its not that helpful, works here (although I might have tweaked my version of the function a bit)

 

Screen Shot 2018-09-18 at 08.15.24.png

Link to comment
Share on other sites

Hooray! it works. Thank you so much

So what I did is ctrl-option-click the parent folder to get the path. Turns out that starting the path name with "/users..." did the trick, i.e. leaving off the "/Macintosh HD" part.

Link to comment
Share on other sites

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