April 3, 200817 yr Newbies 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!
April 8, 200817 yr You can use Applescript to invoke Unix like so: do shell script "chmod 775 /path/to/file"
April 28, 200817 yr 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.
April 28, 200817 yr 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.
April 30, 200817 yr 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.
April 30, 200817 yr 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.
May 1, 200817 yr 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.
May 1, 200817 yr 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.
May 1, 200817 yr 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.
May 1, 200817 yr 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 May 1, 200817 yr by Guest
May 6, 200817 yr Thanks Fenton. Haven't had a chance to try that yet, but thanks very much for the info.
Create an account or sign in to comment