Results 1 to 2 of 2

Thread: silly question from a newbie (AppleScript)

  1. #1

    Member Since
    Feb 10, 2009
    silly question from a newbie (AppleScript)
    I am doing a silly applications in AppleScript that opens and saves the content of a web page:

    tell application "Safari"
    make new document at end of documents
    set URL of document 1 to "www.url.."
    delay 2
    get document 1
    delay 10
    save document 1 in "directory/name.html"
    end tell
    delay 10

    Here comes the catch: Instead of saving name.html, it saves "directory/name.html" as a file in the root directory.

    Can someone help me? I could not find the problem.


  2. #2

    xstep's Avatar
    Member Since
    Jun 25, 2005
    On the road
    A quick test showed that Applescript is set to the root ('/') directory. Well, at least when I post a 'do shell script ' command.

    You either will have to use a full path, or set the path relative to something like your home directory. If relative to your home directory, then try placing '~/' before the directory like this;
    save document 1 in "~/directory/name.html"
    CameraTime - Time lapse photography for novice and advanced users.

    When asking questions, post the version of your software. You'll receive better answers.

    Please post your results to the thread as it is good feedback.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Itunes newbie. Warning: silly questions inside
    By panchoskywalker in forum Music, Audio, and Podcasting
    Replies: 7
    Last Post: 01-20-2014, 01:46 PM
  2. Applescript newbie - How to Fn+F9?
    By Splint in forum macOS - Operating System
    Replies: 4
    Last Post: 06-23-2010, 11:08 PM
  3. Replies: 0
    Last Post: 10-21-2009, 07:10 AM
  4. Applescript newbie
    By revilo in forum macOS - Operating System
    Replies: 3
    Last Post: 09-09-2009, 04:22 AM
  5. Some silly questions from a newbie
    By ourhero in forum Apple Desktops
    Replies: 4
    Last Post: 11-30-2006, 07:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts