Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Oct 25, 2012, 11:34 AM   #1
hfthomp
macrumors member
 
Join Date: Apr 2008
Applescript to Change File Permissions

Hello everyone, I have what I hope is an easy question that I just can't find the answer for...

I have a folder under the /Users/Shared/Pictures on my hard drive. This folder contains Lightroom catalog files and other things. When I create a new Lightroom catalog from my account I save it there. My wife has a user account on the same computer and she likes to be able to the pictures I save into Lightroom. In order to do this, I have to change the permissions on the file everytime.

Right now, my process is read pictures onto computer, import them into a newly created lightroom library (if needed), then using the terminal change the file permissions of the top Pictures folder so that she can read and write to everything in there.

I was wondering if there is a way to create an AppleScript that would allow me to have an icon on the desktop that I could click and then have it automatically go and change the permissions on this folder.

Is that possible? Thanks.
hfthomp is offline   0 Reply With Quote
Old Oct 25, 2012, 02:19 PM   #2
kryten2
macrumors 6502a
 
Join Date: Mar 2012
Location: Belgium
Try this :

Code:
set thePath to "/Users/Shared/Pictures"
set theResult to button returned of (display dialog "This will change permissions on the " & thePath & " folder." with title "Change File Permisssions" buttons {"Cancel", "OK"} default button 2)
if theResult is "OK" then
	set theCommand to do shell script "your terminal command here eg chmod " & quoted form of thePath
end if

(*
-- or without the dialog
		do shell script "your terminal command here eg chmod " & quoted form of thePath
*)
Save as an application and put it on your desktop or drag it into the Finder Toolbar.
__________________
Space Corps Directive 34124

Last edited by kryten2; Oct 25, 2012 at 02:50 PM.
kryten2 is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 05:06 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC