| Weblog: |
|
Homebrew Safari [Updated]
|
| Subject: |
|
AppleScript |
| Date: |
|
2005-08-24 06:16:11 |
| From: |
|
xyz3
|
Response to: AppleScript
|
|
Hi FJ -
If you plan to use rm -rf I suggest using the quoted form command to quote the path:
Example:
set myUserName to (do shell script "whoami")
do shell script "rm -r " & (quoted form of ("/Users/" & myUserName & "/Library/Cookies/" as string))
The shell script line ends up looking something like this: "rm -r '/Users/adminx/Library/Cookies/'"
Also the file at /System/Library/ScriptingAdditions/StandardAdditions.osax has more than a few useful commands you might want to check out.
EX: set myUserName to short user name of (system info)
This is not to say I am condoning using the unix layer, but merely pointing out another way, and other options.
Have fun-
|
Showing messages 1 through 1 of 1.
|
Showing messages 1 through 1 of 1.
|
Feedback and comments are always most welcome! Thank you very much for taking the time to suggest these options.
I have played quite a bit with integrating UNIX and AppleScript before all the new fancy commands appeared and I shamefully confess I need to brush up on them — so a double thanks for pointing them out.
As you can see, the script is prepared for more advanced error detection as well but I haven't implemented that yet.
FJ