advertisement

Weblog:   Homebrew Safari [Updated]
Subject:   AppleScript
Date:   2005-08-24 05:28:50
From:   F.J.
Response to: Applescript

Hi!


Thank you for your reply!


Yes, I am most definitely willing to share the script should anyone find it of interest. The reason I did not from the start is that it plays with "rm" commands and, therefore, could be dangerous should anything go wrong.


I'll edit this entry and add it.


FJ

Full Threads Oldest First

Showing messages 1 through 2 of 2.

  • AppleScript
    2005-08-24 06:16:11  xyz3 [Reply | View]

    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-

    • FJ de Kermadec photo AppleScript
      2005-08-24 06:22:03  FJ de Kermadec | O'Reilly Blogger [Reply | View]

      Hi!

      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

Showing messages 1 through 2 of 2.