Jane in AZ Posted November 9, 2006 Posted November 9, 2006 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
ken_s2007 Posted November 13, 2006 Posted November 13, 2006 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now