Automator/Applescript/Safari Save issue

Discussion in 'Mac Programming' started by Chan, Apr 20, 2010.

  1. Chan macrumors newbie

    Joined:
    Apr 20, 2010
    #1
    First time trying this...so far in Automator I have finder launching safari, pause, run this applescript

    tell application "System Events"
    tell process "Safari"
    click menu item "Save As…" of menu "File" of menu bar 1
    keystroke "xx_" using {shift down}
    key code 36
    end tell
    end tell

    then quit the application, get specified finder tiems and rename them. This runs fine, however, it fails to complete if i have my screensaver/system password on. Is there a way to get around this? I would love to have this run in the background while my workstation is locked.
     
  2. Chan thread starter macrumors newbie

    Joined:
    Apr 20, 2010
    #2
    Updated - the issue is with the Screensaver lock

    It looks like with the screen locked, this workflow will open safari, however it can't access the menu commands to save the webpage/etc. due to the screensaver/passwords box being what's active at the time. Is there a way to send commands on through?
     
  3. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #3
    are you simply trying to dump the contents of a webpage (your home page) to a file on a schedule? If so it might be easier to write a shell script that does what you want using curl, then schedule this to run at the interval desired.

    -Lee
     
  4. Chan thread starter macrumors newbie

    Joined:
    Apr 20, 2010
    #4
    Yup...that is all I am trying to do. Sounds pretty basic, was pretty basic, until I hit that screen lock hurdle. Any suggestions before I try my first attempts at a shell script/curl of which I know nothing about? :D
     

Share This Page