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

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

Recommended Posts

Posted

Let me start by saying that these applescripts worked last year before I moved to a newer Mac (both OSX).

I have run these three scripts in the script editor, and they work fine. I'm thinking it may have something to do with permissions, but I can't remember.

1.tell application "FileMaker Pro"

set chooseFile to cell "PathName" of current record of database "SRename.fp5"

end tell

tell application "Finder"

set name of file chooseFile to "Rename.txt"

end tell

2.do shell script "sudo chmod -R a+wr /Users/redcent/Sites/Documents/Rename.txt" password "******" with administrator privileges

3.tell application "FileMaker Pro"

set newName to cell "FileName" of current record of database "SRename.fp5"

end tell

tell application "Finder"

set name of file "Macintosh HD:Users:redcent:Sites:Documents:Rename.txt" to newName

end tell

I'm thinking it may have something to do with permissions, but I can't remember. Please help.

Jane

Posted

Jane,

If I get a chance to try this in FMP8.5/OS X.4 I will. I realize this isn't what you have.

But a couple of security notes: having the admin password in an AppleScript means it can be opened by just about anyone who has physical access to your computer. I've done the same thing though, and recall there may have been some more secure way of doing it, but I can't recall -- if I find the reference, I'll post it.

If you do continue to use this method, you may want to add a "-K" flag, so "sudo -K", which as I understand it, only executes the sudo privs for that instance, whereas otherwise sudo remains in effect for (I believe) 5 minutes by default.

Ken

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