The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   OS X Developer (http://hintsforums.macworld.com/forumdisplay.php?f=27)
-   -   Replacing a text in applescript (http://hintsforums.macworld.com/showthread.php?t=50904)

tk. 03-01-2006 08:24 AM

need help urgently
 
hi guys...i really need an answer on the last post reply i worte....it is a matter of life and death with my boss!!!!:eek: !!!!!

tk. 03-01-2006 08:27 AM

need help urgently
 
hi guys...i really need an answer on the last post reply i worte....it is a matter of life and death with my boss!!!!:eek: !!!!!
this was it:

Thx man!! it worked but it seems i have some problems with permissions on folder. do u know how can we change a folder permissions??
all i know about this subject is this script:
tell application "Finder"
make new folder at desktop with properties {name:"aNewFolder", owner privileges:{read write}}
end tell

Hal Itosis 03-01-2006 08:51 AM

do shell script "mkdir -p -m 700 ~/Desktop/newdir"

Uh, you never said what permissions you wanted.
700 is secure. 777 is insecure. Tweak as desired.

-HI-

tk. 03-01-2006 09:04 AM

i want read write permission on an already created folder...not a new one,,,!!!

tk.

Hal Itosis 03-01-2006 02:28 PM

read write ... but no "execute"!?!?!?
read write for who besides owner (group and/everyone)???

You are not at all clear. What's wrong with the permissions?
When a user creates a folder on their desktop, they already
get read write and execute (search) permissions.

Study some UNIX (like man chmod). Anyway, this should do:
do shell script "chmod 777 ~/Desktop/foldername"

tk. 03-02-2006 02:36 AM

i really need some urgent help overhere guys....
i need to change the permission of an already present file....
someone mentioned a do shell script....
tk.

tk. 03-02-2006 02:40 AM

thx guys....
i dont know but it seems i had some rfreshing problem....i couldnt see the new things u wrote....
anyways thx again....it WORKED....m SAVED!! :D!!

tk. 03-06-2006 11:11 AM

Hi,

I am writing the following script which consist of editing a file automatically using applescript...my problem is that i can only perform the modification ONCE!!

set hd to path to desktop
set astid to AppleScript's text item delimiters
set AppleScript's text item delimiters to ":"
set hdname to first text item of (hd as string)
set AppleScript's text item delimiters to astid
set httpd_old to alias ((hdname & ":Testfolder:test.txt") as Unicode text)
set AppleScript's text item delimiters to ""
set AppleScript's text item delimiters to "a path to edit"
set text_items_of_httpd_old to text items of (read httpd_old) --A list that contains 2 chunks of text: Everything before the original line, and everything after
set publFolder to (path to "pubb")
set uPath to POSIX path of publFolder
set u2Path to uPath & theName
set AppleScript's text item delimiters to u2Path
set httpd_new to text_items_of_httpd_old as Unicode text --New text for your new conf file
write httpd_new to alias ((hdname & ":Testfolder:test.txt") as Unicode text)


When i run the script for the first time....the path changes.....but if i need to do it and edit something else....it keep giving me the same result....

can u help me with it please....if there is anything unclear about the script let me know...!!
tk.

tk. 03-07-2006 10:01 AM

need helpp!!!
 
anyone availble guys

tk. 03-07-2006 10:03 AM

need helpp!!!
 
anyone available guys


All times are GMT -5. The time now is 06:04 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.