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

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

Recommended Posts

  • Newbies
Posted

Hey everyone. I am new to both Filemaker, Applescript, and this forum. Thanks for all of the helpful stuff you have posted here! It's a great forum.

I have been hunting around trying to find an answer to this, and I am sure it has probably been asked before on this forum, but I can't seem to find it.

We have a script in our FM9 file that uses Applescript to generate a folder on our desktop. We need to change the permissions on this folder to be 775 (Read/Write/Executable by both Owner and Groups). What would this Applescript look like?

Any help is much appreciated!

Posted

You can use Applescript to invoke Unix like so:

do shell script "chmod 775 /path/to/file"

  • 3 weeks later...
Posted

I'm trying to do almost the same thing... change the permissions of files and folders to 777, read/write access for owner, group, and everyone else. In terminal mode I have to say -R 777. In this shell script here I see only 775. If I just insert the 777 in place of the 775 will that work, or do I need the -R in there for something.

Thanks a lot.

Posted

The -R makes it recursive, i.e. it will apply the permissions to all files and subfolders. I imagine you'll want to leave it in, if it's doing what you want.

Posted

Thanks.

I tried the shell script as shown but I get an error that there is no such file or directory. I suspect I'm not using the right syntax for my mac (OS 10.3.9). I'm saying

do shell script "chmod 777 Chuck_HD:Users:chuck:Desktop:POSOE4batch.csv"

Where Chuck_HD is the name of the hard drive. Should that work?

Thanks a lot for the help.

Posted

I think the path would start with /Users/ and would use slashes, not colons. Fire up Terminal and drag the file into the Terminal window, you'll see the path.

Posted

Easiest Unix path to User's home folder is the shortcut: ~/

So their desktop is: ~/Desktop

This shortcut does not work in FileMaker syntax paths (unfortunately).

Also does not work if escaped, enclosed in single quotes: '~/'

Though you can enclose other parts of the path in single quotes where needed.

Posted

You are correct, Fitch... the path starts /Users.. It works! Great! Thanks. And dragging the file into Terminal is a great trick. Thanks for the help.

Thank you, Fenton, for your input also. It really is great to be able to come here and get answers to things that have stumped me. ...It's unfortunate that stumping me is not that hard to do...

Thanks again.

Posted

Well... now I've got the question that HAD to follow... can I do this (change permissions) to a file on a different computer on the LAN? I dragged the file into Terminal and it gave me /Volumes/username/... Which means I have to already be connected via OS (I think). Is there a way to do it without having to manually connect?

Thanks in advance, guys.

Posted (edited)

You can mount a remote volume with AppleScript, example:


tell application "Finder"

	mount volume "afp://192.168.168.4/volume name" as user name "xxx" with password "yyy"

end tell

[P.S. The volume name can have spaces in the name, i.e. "Macintosh HD".]

[P.P.S. There may be a Unix way to change permissions without mounting the volume. I'm not that kind of geek :-]

Edited by Guest

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