Topic: anyone know Applescript? (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=28894" title="Pages that link to Topic: anyone know Applescript? (Page 1 of 1)" rel="nofollow" >Topic: anyone know Applescript? <span class="small">(Page 1 of 1)</span>\

 
CPrompt
Maniac (V) Inmate

From: there...no..there.....
Insane since: May 2001

posted posted 02-07-2007 15:21

I need a script that will set the permissions to every file in a given folder to 777.

I have tried :

code:
tell application "Finder"

set theFolder to "/Users/Username/Desktop/myFolder "
set theFiles to every file of theFolder

repeat with a from 1 to length of theFiles
	chmod 777
end repeat

end tell



this doesn't work.

I also looked at using the Folder Actions and doing

code:
on adding folder items to this_folder
	tell application "Finder"
		do script "chmod 777"
	end tell
end adding folder items to



But that doesn't seem to work either.

Any help is much appreciated!

Thanks in advance!

Later,

C:\

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 02-07-2007 17:59

Does it have to be apple script?
OS X is a complete unix... you could just have a bash script calling chmod 777 * -R ...

so long,

->Tyberius Prime

CPrompt
Maniac (V) Inmate

From: there...no..there.....
Insane since: May 2001

posted posted 02-07-2007 22:31

ah. good call. Not sure why I didn't think of that. I need more sleep

I think I can write a bash script that would do it. I think...

Later,

C:\

CPrompt
Maniac (V) Inmate

From: there...no..there.....
Insane since: May 2001

posted posted 02-07-2007 23:06

actually come to think of it, yeah I guess it does need to be done in Applescript. Unless a bash script can just be double clicked on to run. I've done some bash scripts for mac before and it just opens in that stupid text editor.

I'm probably doing something wrong though

Later,

C:\

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 02-07-2007 23:29

I'll have to look tomorrow (more like late tomorrow), but I'd assumed that if you set the execution bit on a text file created in some command line editor, it shouldn't open the text editor...

CPrompt
Maniac (V) Inmate

From: there...no..there.....
Insane since: May 2001

posted posted 02-08-2007 15:41

that's cool. It is no major rush. I appreciate your help

Later,

C:\

Iron Wallaby
Paranoid (IV) Inmate

From: USA
Insane since: May 2004

posted posted 02-13-2007 06:21

I'm with TP on this one: did you remember to chmod +x your bash script? I'm pretty sure that it executes in the Finder if it's flagged as executable.

---
Website

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 02-13-2007 09:15

Haven't had any luck getting the finder to run it - stil working on it, though.

Steve
Maniac (V) Inmate

From: Boston, MA, USA
Insane since: Apr 2000

posted posted 02-13-2007 13:17

Have you looked into the Automator application? Once you have launched the app, if you select Automator from the app list on the left, Run Shell Script is an option for that app. Might be what you need.

Skaarjj
Maniac (V) Mad Scientist

From: :morF
Insane since: May 2000

posted posted 02-14-2007 07:35

Or you could just load up iTerm, and run the script...


Justice 4 Pat Richard

Iron Wallaby
Paranoid (IV) Inmate

From: USA
Insane since: May 2004

posted posted 02-14-2007 07:40

If only it were called iTerm...

Which reminds me! Several years back, when Apple first unveiled Safari, I remember musing that they should have called it iBrowse, which has an ironic quality that I like...

---
Website

Skaarjj
Maniac (V) Mad Scientist

From: :morF
Insane since: May 2000

posted posted 02-14-2007 12:21

There's a terminal application for OS X called iTerm. I use it all day every day at work.


Justice 4 Pat Richard

Steve
Maniac (V) Inmate

From: Boston, MA, USA
Insane since: Apr 2000

posted posted 02-14-2007 23:04

"Or you could just load up iTerm, and run the script..."

Doesn't that overlook the requirement that this be a double-click-to-run thing? You can compile the automator action to be an application. Don't need to "fire up" anything. Could also make it a folder script....

Iron Wallaby
Paranoid (IV) Inmate

From: USA
Insane since: May 2004

posted posted 02-15-2007 14:42
quote:

Skaarjj said:

There's a terminal application for OS X called iTerm. I use it all day every day at work.



Wow, you're kidding! I just Googled and found it, how interesting...

---
Website



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu