Jump to content
Sign in to follow this  
T-Square

Applescript to create folders below installation

Recommended Posts

I have a solution that needs to have two sub-folders for long-term running. I have created an opening script that checks whether the solution has been installed, and if not, creates the folders for me. In Windows, I have a simple batch file that runs from a Send Message script command. I assume that I should use Applescipt on the Mac, but not being a Mac person, I have not been able to figure out a couple of (admittedly basic!) things:

1) I want Applescript to create the folders under the main database folder, which could be anywhere. Every example of Finder scripts specify the exact location of a newly-created folder. I do not know how to instruct Applescript to do this.

2) Once I have an Applescript, I can only seem to instruct FM to call up Script Editor--not actually run the script. The Script step looks like:

Send Apple Event["init","Script Editor", "misc", "dosc"]

I am sure that these problems are easy to fix, but do not know what to change.

Thanks,

David

Share this post


Link to post
Share on other sites

Well...

let's see. What you need to do is provide the applescript with the path to your database. This is not too hard - what you can do is set a calc field in the DB to Status(CurrentFilePath), and then parse out the file name using a substitute command with Status(CurrentFileName). This will give you the path to the root of your install. Right?

Share this post


Link to post
Share on other sites

I'm going to guess that the Status(CurrentFilePath) is an addition to FM after 4.0, because it doesn't appear in my 4.0. That command would really help this process!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

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