Calendar alarm fails to run Automator script if Mac is sleeping

I have an Automator script to run a backup task which is saved as a Calendar alarm to run once every week.
This was working perfectly in Snow Leopard - if the computer was asleep at the alarm time, then it would simply run the next time the computer is woken up.
Then I upgraded to Mountain Lion, and had various issues. First, the alarm got imported to iCloud and caused unwanted pop-up alerts on all my iOS devices, but I resolved that by moving the alarm's calendar from "iCloud" to "On My Mac" (described here).
Now I'm finding that if the computer is asleep at the alarm time, the script doesn't run at all.
I don't want the computer to wake up in order to run the script, but to run the next time the computer is woken up, just like it did on Snow Leopard.
Is this a known difference in behaviour between Snow Leopard and Mountain Lion, and is there any way to get the old behaviour?

As no-one has confirmed whether this is expected behaviour or a bug, I've assumed it is a bug and raised a bug report at http://www.apple.com/feedback/macosx.html.
In the meantime, I've created a repeating task in my To Do list app to remind me to run the backup script once a week (I'm using Cultured Code "Things" for task management).
When the task pops up, I run the Automator workflow MANUALLY by double-clicking on the workflow ".app" file.
It seems insane, but this is the only way I can be sure the Automator script runs once a week.

Similar Messages

  • Call failing at Run External Script

     Dear All,
    i installed UCCE with CVP (Ver 10.0.1). 
    Call Flow CME-->VXML GW-->CVP-->ICM. But call is failing at run External script. I am attaching CVP error Log and ICM Script.
    pls suggest.
    1469: 10.35.133.129: Sep 16 2014 11:19:38.981 +0530: %CVP_10_0_IVR-3-CALL_ERROR:  CALLGUID=044224283C9A11E4803A30F70D96B740 DNIS=11111111116 Media Fetch Error for URL=file://../MediaFiles/en-us/app/Welcome.wav (Client: 10.35.133.194) [id:3023] 
    1470: 10.35.133.129: Sep 16 2014 11:19:38.981 +0530: %CVP_10_0_IVR-3-CALL_ERROR:  RunScript Error from 10.35.133.194 [MEDIA_FILE_NOT_FOUND(9)] CALLGUID: 044224283C9A11E4803A30F70D96B740 DNIS=11111111116 {VRUScriptName: 'PM,Welcome,A' ConfigParam: 'Y'} [id:3023] 
    2285: 10.35.133.129: Sep 16 2014 11:19:38.996 +0530: %CVP_10_0_SIP-3-SIP_ERROR_SNMP:  B2BUA is not configured with a route for making calls to [91919191]. Please add this route. [id:5010] 
    1487: 10.35.133.129: Sep 16 2014 11:19:41.087 +0530: %CVP_10_0_IVR-3-CALL_ERROR:  Removing CALLGUID: 044224283C9A11E4803A30F70D96B740 DNIS=1111111111 due to exception in CallNewHandler. (Client: 10.35.133.194) Received ICM DialogFailure response for new call request. DialogFailure StatusCode: 15 HTTP req: { RECOVERY_VXML=flash:recovery.vxml, CALL_DNIS=1111111111, CALL_UUI=, MSG_TYPE=CALL_NEW, ERROR_CODE=NONE(0), CALL_ID=044224283C9A11E4803A30F70D96B740, CLIENT_TYPE=IOS, CALL_ANI=sip:[email protected]:5060 } [id:3023] 
    1496: 10.35.133.129: Sep 16 2014 11:19:42.117 +0530: %CVP_10_0_IVR-3-CALL_ERROR:  Removing CALLGUID: 044224283C9A11E4803A30F70D96B740 DNIS=1111111111 due to exception in CallNewHandler. (Client: 10.35.133.194) Received ICM DialogFailure response for new call request. DialogFailure StatusCode: 15 HTTP req: { RECOVERY_VXML=flash:recovery.vxml, CALL_DNIS=1111111111, CALL_UUI=, MSG_TYPE=CALL_NEW, ERROR_CODE=NONE(0), CALL_ID=044224283C9A11E4803A30F70D96B740, CLIENT_TYPE=IOS, CALL_ANI=sip:[email protected]:5060 } [id:3023] 
    1505: 10.35.133.129: Sep 16 2014 11:19:43.146 +0530: %CVP_10_0_IVR-3-CALL_ERROR:  Removing CALLGUID: 044224283C9A11E4803A30F70D96B740 DNIS=1111111111 due to exception in CallNewHandler. (Client: 10.35.133.194) Received ICM DialogFailure response for new call request. DialogFailure StatusCode: 15 HTTP req: { RECOVERY_VXML=flash:recovery.vxml, CALL_DNIS=1111111111, CALL_UUI=, MSG_TYPE=CALL_NEW,
    Regards,
    Mukesh Singh

    You have media fetch error,the URL being formed is below:
    file://../MediaFiles/en-us/app/Welcome.wav
    should be something like http://x.x.x.x/en-us/app/welcome.wav
    also please share your full CVP logs for the call.
    it is always annoying to see b2b user agent is not configured, so please configure ringtone and error label to sent to proper VXML gateway.
    regards
    Chintan

  • Nokia 5800 v31 calendar alarm fail

    HI!
    I have upgraded my 5800 xm to v31.
    Now i have the clock bug, the alarm always goes off 3 or 4 minutes after the hour i expected.
    Worst than that is that every time i set a calendar alarm it doesn't do anything! When i go to calendar it says:
    "1 or more calendar alarms failed due to hour change"
    Does anyone have the same problem? Is there a way out?
    Best regards
    Sandgrain

    There has also been cases of users changing snooze time from 5 to 10 min ( just the changing, whatever time you set it to) and solves the alarm for a little while. The bug is totally random.
    My first 5800 on v30 had this issue - did a reset and it fixed the alarm for about 4 days before it continued to go off a couple of mins late. My second 5800 on 31 did not have it the first 3 weeks untill one night... You might be lucky or you might not be. It's totally random so chanchans advice getting a 3rd party alarm would be the thing. V40 solves it.

  • Running Maintenance Scripts for Mac OS 10.5.8 HELP!

    I am trying to run the maintenance scripts on my laptop for the first time. I go to Terminal type in "sudo periodic daily weekly monthly" and hit return. A warning message pops up the some data may be lost.... and the the Password prompt comes up. I back up consistently so I just want to run the scripts since it has never been done. However, when I try to type in my password, NOTHING types. I hit return and tried again, but nothing. Can someone please help me figure out what is wrong and if there is any other maintenance I need to do to the system?
    Thanks in advance for any help.

    You don't need to use any utility, or perform any procedure, to make sure OS X's built-in maintenance tasks have run under OS X 10.5 and later.
    OS X 10.5 will run its cron jobs automatically (actually, they are no longer handled by the UNIX facility "cron", they are now handled by a similar facility called "launchd". if that means anything to you) whether you have left your computer on all night or not. You no longer need a utility to run missed maintenance as of OS X 10.5. It will run automatically at the next available opportunity. Actually, this was the case as of OS X 10.4, but a bug kept the maintenance routines from running more than once per restart under OS X 10.4. This was fixed in OS X 10.5
    http://discussions.apple.com/message.jspa?messageID=6552347
    http://arstechnica.com/reviews/os/macosx-10.4.ars/5
    http://developer.apple.com/macosx/launchd.html

  • Execute Applescript in Automator: fails when running Automator action

    I am trying to get a simple Automator action to switch spaces every so often. I'm following directions found on MacScripter. The Applescript runs and works on it's own, or when I run the applescript from inside the Execute Applescript window of Automator. But when I run the automator action, the Execute Applescript action fails. Here's the Applescript code I've entered into the Execute Applescript window:
    tell application "System Events"
    keystroke "2" using control down
    end tell
    Again, this runs and does what it should if I click the Run button in the Execute Applescript window of the automator action. It fails when I run the whole automator action. This Execute Applescript is the first action in the automator sequence.
    What am I missing?
    Thanks!

    Are you using the Run AppleScript action's run handler? The parameters are used to connect the action to Automator:
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px;
    color: #000000;
    background-color: #FFDDFF;
    overflow: auto;"
    title="this text can be pasted into an Automator 'Run AppleScript' action">
    on run {input, parameters}
    tell application "System Events"
    keystroke "2" using control down
    end tell
    return input
    end run
    </pre>

  • Deployment failing when running .bat script or command line file package

    HI Guys,
    I am trying to run a .bat file on a client using a program. My data source point to the script's folder.
    I keeps failing with error 1. 
    I have trying making run in 64-bit using this without luck: http://madluka.wordpress.com/2012/09/24/configmgr-2012-64bit-file-system-redirection-bites-again/
    Here is the content of my .bat file:
    @ECHO OFF
    IF NOT "%PROCESSOR_ARCHITEW6432%"=="AMD64" GOTO native
      ECHO "Re-launching Script in Native Command Processor..."
      %SystemRoot%\Sysnative\cmd.exe /c %0 %*
      EXIT
    :native
    ECHO "Running Script in Native Command Processor..."
    c:\
    cd c:\windows\System32
    start cmd.exe /c shutdown -l
    stop
    I will get the same error when running a simply command line as well. Instead of a .bat file.
    any ideas?

    Maybe this will help you:
    http://blog.coretech.dk/kea/configuration-manager-shutdown-utility
    This instead of using "shutdown.exe -l" command. This tool can be used for logoff also. Hope it helps!
    My blogs: Henk's blog and
    Virtuall | Follow Me on:
    Twitter | View My Profile on:
    LinkedIn

  • ODI fails when running MAXL scripts

    HI,
    We have a problem with ODI where when a scenario has a maxl script as a step the scenario fails.
    This is not a problem in our production environment but it is present in our DEV and TEST environments. We believe it may be a problem with the cloning process from PROD.
    Has anyone had this issue previously or can provide some helpful direction.
    Regards
    Luke
    ODI 10.1.3.5

    What is the error you are getting at the failure point?

  • Automatic startup/shutdown failed. Running the script manual..works...

    Hi,
    DB: Oracle9i
    Os: solaris 9
    /etc/rc0.d K05oracle -> /etc/init.d/oracledb
    /etc/rc3.d SS85oracle -> /etc/init.d/oracledb
    Oratab: i have put yes.
    Please help to resolve this issue...where can i check the startup log?
    what else i need to check?
    Thanks,
    Siva.

    Thanks for your reply....
    Script:
    #!/bin/sh
    case "$1" in
    'start')
    # Sets ORACLE_HOME to latest version on machine
    # ORACLE_HOME="`cut -d ":" -f 2 /var/opt/oracle/oratab | sort | tail -1`"
    ORACLE_HOME=`grep -v "^#" /var/opt/oracle/oratab|grep -v "^$"|cut -d ":" -f 2 | sort | tail -1`
    export ORACLE_HOME
    PATH=$PATH:$ORACLE_HOME:$ORACLE_HOME/bin
    # If you are running Oracle's Multi-Threaded Server, the SQL*Net
    # listener service must be started before the database is started.
    # If it is not, your dispatcher(s) will not start.
    if [ -f $ORACLE_HOME/bin/dbstart ]
    then
    echo "Starting up Oracle databases."
    su oracle -c "LD_LIBRARY_PATH=$ORACLE_HOME/lib;export LD_LIBRARY_PATH;$ORACLE_HOME/bin/lsnrctl start"
    su oracle -c "LD_LIBRARY_PATH=$ORACLE_HOME/lib;export LD_LIBRARY_PATH;$ORACLE_HOME/bin/dbstart"
    else
    echo "Can't find Oracle startup file."
    fi
    'stop')
    # Sets ORACLE_HOME to latest version on machine
    ORACLE_HOME="`cut -d ":" -f 2 /var/opt/oracle/oratab | sort | tail -1`"
    export ORACLE_HOME
    PATH=$PATH:$ORACLE_HOME:$ORACLE_HOME/bin
    if [ -f $ORACLE_HOME/bin/dbshut ]
    then
    echo "Shutting down Oracle databases."
    su oracle -c "LD_LIBRARY_PATH=$ORACLE_HOME/lib;export LD_LIBRARY_PATH;$ORACLE_HOME/bin/dbshut"
    su oracle -c "LD_LIBRARY_PATH=$ORACLE_HOME/lib;export LD_LIBRARY_PATH;$ORACLE_HOME/bin/lsnrctl stop"
    else
    echo "Can't find Oracle shutdown file."
    fi
    echo "Usage: /etc/init.d/database { start | stop }"
    esac

  • Need Help with running expect script on MAC OS

    Hi Guys,
    I'm having an issue with running an expect script on my Mac Mini with Mac OS x 10.7.5. I think the script is correct but the not sure why its not working.
    The script is as below and also teh error from Xtern or terminal when i try to run it.
    #!/usr/bin/expect
    set telnetAddr "172.22.22.254"
    set telnetAddr1 "172.22.22.252"
    set username "ww"
    set passwords "ww"
    set enablepassword "ww"
    spawn  telnet $telnetAddr
    expect "Username: "
    send "username\r"
    expect "Password: "
    send "$passwords\r" 
    expect "Orange-ISRGW>"
    send "enable\r"
    expect "Password: "
    send "$enablepassword\r"
    expect "Orange-ISRGW#"
    send "sh flash\r"
    expect "Orange-ISRGW#"
    send "delete flash:c1140-k9w7-tar.default.JAR\r"
    expect "Delete flash:/c1140-k9w7-tar.default.JAR? [confirm]"
    send  "\r"
    expect "Orange-ISRGW#"
    send "exit/r"
    interact
    here is what happens when i try to run it. This is just a test script before i re-write it to do what i intened to use it for.
    sh-3.2# ls -al Text-Script.txt
    -rwxrwxrwx@ 1 root  wheel  592 Dec  6 08:36 Text-Script.txt
    sh-3.2# more Text-Script.txt
    #/!/usr/bin/expect -f
    set telnetAddr "172.22.22.254"
    set username "ww"
    set passwords "ww"
    set enablepassword "ww"
    spawn telnet $telnetAddr
    expect "Username: "
    send "username\r"
    expect "Password: "
    send "$passwords\r" 
    expect "Orange-ISRGW>"
    send "enable\r"
    expect "Password: "
    send "$enablepassword\r"
    expect "Orange-ISRGW#"
    send "term length 0\r"
    expect "Orange-ISRGW#"
    send "sh flash\r"
    expect "Orange-ISRGW#"
    send "delete flash:c1140-k9w7-tar.default.JAR\r"
    expect "Delete flash:/c1140-k9w7-tar.default.JAR? [confirm]"
    send  "\r"
    expect "Orange-ISRGW#"
    send "exit/r"
    sh-3.2#
    sh-3.2# pwd
    /usr/bin
    sh-3.2# Text-Script.txt
    /usr/bin/Text-Script.txt: line 8: spawn: command not found
    couldn't read file "Username: ": no such file or directory
    /usr/bin/Text-Script.txt: line 10: send: command not found
    ": no such file or directory:
    /usr/bin/Text-Script.txt: line 12: send: command not found
    ": no such file or directorySRGW>
    /usr/bin/Text-Script.txt: line 14: send: command not found
    couldn't read file "Password: ": no such file or directory
    /usr/bin/Text-Script.txt: line 16: send: command not found
    ": no such file or directorySRGW#
    /usr/bin/Text-Script.txt: line 18: send: command not found
    ": no such file or directorySRGW#
    /usr/bin/Text-Script.txt: line 20: send: command not found
    ": no such file or directorySRGW#
    /usr/bin/Text-Script.txt: line 22: send: command not found
    ": no such file or directorylash:/c1140-k9w7-tar.default.JAR? [confirm]
    /usr/bin/Text-Script.txt: line 24: send: command not found
    ": no such file or directorySRGW#
    /usr/bin/Text-Script.txt: line 26: send: command not found
    sh-3.2#
    sh-3.2#
    sh-3.2# ./Text-Script.txt
    ./Text-Script.txt: line 8: spawn: command not found
    couldn't read file "Username: ": no such file or directory
    ./Text-Script.txt: line 10: send: command not found
    ": no such file or directory:
    ./Text-Script.txt: line 12: send: command not found
    ": no such file or directorySRGW>
    ./Text-Script.txt: line 14: send: command not found
    couldn't read file "Password: ": no such file or directory
    ./Text-Script.txt: line 16: send: command not found
    ": no such file or directorySRGW#
    ./Text-Script.txt: line 18: send: command not found
    ": no such file or directorySRGW#
    ./Text-Script.txt: line 20: send: command not found
    ": no such file or directorySRGW#
    ./Text-Script.txt: line 22: send: command not found
    ": no such file or directorylash:/c1140-k9w7-tar.default.JAR? [confirm]
    ./Text-Script.txt: line 24: send: command not found
    ": no such file or directorySRGW#
    ./Text-Script.txt: line 26: send: command not found
    sh-3.2#

    Works like a Charm after making the change suggested ..
    macminiserver:ExpectScript Tola$ more Text-Script.txt
    #! /usr/bin/expect -f
    set telnetAddr "172.22.22.254"
    set username "ww"
    set passwords "ww"
    set enablepassword "ww"
    spawn telnet $telnetAddr
    expect "Username: "
    send "$username\r"
    expect "Password: "
    send "$passwords\r" 
    expect "Orange-ISRGW>"
    send "enable\r"
    expect "Password: "
    send "$enablepassword\r"
    expect "Orange-ISRGW#"
    send "term length 0\r"
    expect "Orange-ISRGW#"
    send "sh flash\r"
    expect "Orange-ISRGW#"
    send  "delete flash:c1140-k9w7-tar.default.JAR\r"
    send  "\r"
    expect "Orange-ISRGW#"
    send "sh flash\r"
    interact
    macminiserver:ExpectScript Tola$ ./Text-Script.txt
    spawn telnet 172.22.22.254
    Trying 172.22.22.254...
    Connected to 172.22.22.254.
    Escape character is '^]'.
    User Access Verification
    Username: ww
    Password:
    Orange-ISRGW>enable
    Password:
    Orange-ISRGW#term length 0
    Orange-ISRGW#sh flash
    -#- --length-- -----date/time------ path
    2         1440 Oct 24 2013 11:23:26 -07:00 vlan.dat
    3     63714548 May 3 2010 11:49:40 -07:00 c2800nm-adventerprisek9_ivs_li-mz.151-1.T.bin
    5     67871024 Nov 9 2012 19:05:24 -08:00 c2800nm-adventerprisek9-mz.151-4.M5.bin
    124751872 bytes available (131600384 bytes used)
    Orange-ISRGW#delete flash:c1140-k9w7-tar.default.JAR
    Delete flash:/c1140-k9w7-tar.default.JAR? [confirm]
    %Error deleting flash:/c1140-k9w7-tar.default.JAR (File not found)
    Orange-ISRGW#sh flash
    -#- --length-- -----date/time------ path
    2         1440 Oct 24 2013 11:23:26 -07:00 vlan.dat
    3     63714548 May 3 2010 11:49:40 -07:00 c2800nm-adventerprisek9_ivs_li-mz.151-1.T.bin
    5     67871024 Nov 9 2012 19:05:24 -08:00 c2800nm-adventerprisek9-mz.151-4.M5.bin
    124751872 bytes available (131600384 bytes used)
    Orange-ISRGW#

  • Application express installation is failed while running apxdevrm.sql scrip

    Hello Experts,
    i am new to Oracle Application express. My installation is failed while running the script (apxdevrm.sql).
    here is the command i ran as sysdba
    @apexins xxxxx apex apex temp /i/
    installation is exited with the following error :
    REPORT:SYS> prompt Set Application ID...
    Set Application ID...
    REPORT:SYS>
    REPORT:SYS> begin
    2
    3 -- SET APPLICATION ID
    4 wwv_flow.g_flow_id := nvl(wwv_flow_application_install.get_application_id,4411);
    5 wwv_flow_api.g_id_offset := nvl(wwv_flow_application_install.get_offset,0);
    6 null;
    7
    8 end;
    9 /
    REPORT:SYS>
    REPORT:SYS> --application/delete_application
    REPORT:SYS>
    REPORT:SYS> begin
    2
    3 -- Remove Application
    4 wwv_flow_api.remove_flow(nvl(wwv_flow_application_install.get_application_id,4411));
    5
    6 end;
    7 /
    begin
    ERROR at line 1:
    ORA-20001: API operation includes calls that are incompatible with the current runtime.
    ORA-06512: at "APEX_030200.WWV_FLOW_API", line 32
    ORA-06512: at "APEX_030200.WWV_FLOW_API", line 247
    ORA-06512: at line 4
    here is my database version :
    REPORT:SYS> select * from v$version;
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE 11.2.0.2.0 Production
    TNS for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    OS version :
    cat /etc/redhat-release
    Red Hat Enterprise Linux Server release 5.6 (Tikanga)
    any one had this issue in the past?
    your help is greatly appreciated.
    Edited by: 892564 on Oct 20, 2011 4:15 PM

    Hello experts,
    is there any best way to trouble shoot the error which i got?
    Thanks
    !# Pavan

  • ICal failing to run applescripts: The 'Open' button does not change to 'Run', and the script file is opened but not executed on alert.

    iCal failing to run applescripts: The 'Open' button does not change to 'Run', and the script file is opened but not executed.

    Calendar (not called iCal anymore) does not include that capability any longer, apparently.  What you have to do now is go to Automator and create a Calendar Alert action.  You can add a Run AppleScript object to the action and paste in your script there, then when you save it, it will become available as a choice in the alert menu in Calendar.

  • Automator Calendar Alarm/iTunes Help

    I have created a Calendar Alarm in Automator to play an internet Radio Station using an iTunes playlist at a specific time.  The  Automator script works fine and the streaming radio starts and runs perfectly when my laptop is running normally during the day.
    Specific sequence:
    Get Specified iTunes Items - which is a streaming radio station set up as a playlist
    Play iTunes Playlist
    Set Computer Volume
    Set iTunes Playing
    My reason for creating this script is for a Wakeup Radio Alarm.  I have my MacBook Pro wake from sleep using the Schedule facility in Energy Saver 5 minutes before the radio alarm is due to start.  No problems, the laptop wakes from sleep mode.
    But when the Calendar Alarm script activates I then get an unhelpful error message saying “The action "Get Specified iTunes Items" encountered an error.  Check the action’s properties and try running the workflow again”.  No other information is provided.
    Then when I switch to iTunes I receive a message saying “iTunes is running in safe mode.  Visual plug-ins you have installed have been temporarily disabled.”  I have not added any plug-ins to iTunes.
    After cancelling the 2 error messages from the above, opening the Calendar Alarm script now with Automator and running it produces no errors whatsoever and the radio station starts playing.
    Any ideas please?
    Rob

    Trust this is what you call the script.
    And as stated in my original post this is the log from running this app in Automator:
    It runs fine like this and the radio station plays but NOT after waking my MacBook from sleep mode as explained in my original post.
    Rob

  • Run Python Script in Automator

    I have a python script (which was written for me), and I would like to make it so that the script executes every x minutes. I know this should be simple to do, but I can't figure it out.
    Thus far, I have created a workflow in automator, used the "Run Shell Script" action, and pasted the script into the text field.
    "Workflow failed - 1 error
    I'm very new to this, so I'm sure it's a simple error. Any help would great.
    Here is the script I am trying to execute.
    #!/Library/Frameworks/Python.framework/Versions/2.7/bin/python
    # you can change the above line to point to the location of python
    # on your system (you can check this by typing 'which python' into
    # Terminal.app), but this isn't necessary if you execute the script
    # using "python ksl.py [URL]"
    # change the value of NAME to your desired name
    NAME = "Bob Jones"
    # change the value of EMAIL to your desired email
    EMAIL = "[email protected]"
    # your message will be the contact name as mined from the page source,
    # followed by whatever message you enter between the following triple quotes
    MESSAGE = """Replace this text with your message. Newlines are also OK."""
    import mechanize
    import re
    import sys
    def setupBrowser(url):
    b = mechanize.Browser()
    # b.sethandlerobots(False)
    # b.addheaders = [('User-agent', 'Mozilla/4.0 (compatible; MSIE 6.0; Windows XP)')]
    try:
    b.open(url)
    except mechanize._mechanize.BrowserStateError:
    print >> sys.stderr, "You have mistyped the URL. It must by in the following format, including the quotes and the preceding 'http://':\n\t %s [--test] 'http://www.blah.com'" % (sys.argv[0])
    sys.exit(1)
    return b
    def grabLinks(b):
    """Takes in a mechanize.Browser() object pointed to a listings URL and returns a listing of classified ad links."""
    links = []
    for link in b.links():
    # change this line if the URL format ever changes
    if re.search(r'&ad=', link.url):
    links.append(mechanize.urljoin(link.base_url, link.url))
    return links
    if _name_ == '_main_':
    # check for proper command line args
    if len(sys.argv) != 2 and len(sys.argv) != 3:
    print >> sys.stderr, "Usage: %s [--test] url" % (sys.argv[0])
    sys.exit(1)
    args = sys.argv[1:]
    if len(args) == 1:
    # start from listings page
    url = args[0]
    # set up the mechanize browser object
    b = setupBrowser(url)
    # grab only the relevant ad links
    links = grabLinks(b)
    if not links or len(links) == 0:
    # the links do not follow the same format as the original page
    print >> sys.stderr, "The link format has changed, or you have mistyped the URL."
    sys.exit(1)
    # open the first link on the listings page
    b.open(links[0])
    else:
    # start from a single listing
    if args[0] != "--test":
    print >> sys.stderr, "Usage %s [--test] url"
    sys.exit(1)
    url = args[1]
    b = setupBrowser(url)
    # grab the HTML so that we can search for the contact name
    response = b.response().get_data()
    # perform a regex search on the HTML for the contact name
    regexSearch = re.search(r'Contact Name:\s*\s(w+)s', response)
    contactName = ""
    if regexSearch:
    # contact name found -- store it
    contactName = regexSearch.group(1)
    else:
    # contact name not found -- use generic greeting
    contactName = "Hello"
    theOne = ""
    # find the "Email Seller" link (stored as "theOne")
    for link in b.links():
    # again, if the URL changes, change this line
    if re.search(r'xmldb=', link.url):
    theOne = mechanize.urljoin(link.base_url, link.url)
    if theOne == "":
    # something went wrong
    print >> sys.stderr, "'Email Seller' link has changed formats within the HTML."
    sys.exit(1)
    b.open(theOne)
    # fill out the forms. note that I am grabbing the SECOND form here.
    # again, this might change over time, so feel free to change this from
    # nr=1 to nr=0 (for the first form), nr=2 (for the third form), etc.
    b.select_form(nr=1)
    b['form_4'] = NAME
    b['form_5'] = EMAIL
    # append the contact name to the rest of the message
    MESSAGE = contactName + """,\n\n""" + MESSAGE
    b['form_6'] = MESSAGE
    # submit the form
    b.submit()
    b.close()

    If the script works, and all you need is to execute every x minutes, use launchd, and its simple to write with the Lingon GUI: http://sourceforge.net/projects/lingon/files/

  • Update fails (Failed to run database update script)

    Still unable to update my zmm. it fails to uppgrade the sqldb.
    logfiles ends like this.
    Msg 512, Level 16, State 1, Server xxxxx, Procedure , Line 2
    [Microsoft][ODBC SQL Server Driver][SQL Server]Subquery returned more than 1
    value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or
    when the subquery is used as an expression.
    The statement has been terminated.
    1> 2> 3> 4> 5> 6> 7> [17:04:44] RunShellCommand: Command: osql exited with code: 1
    [17:04:44] RunShellCommand: Exit code indicates failure.
    [17:04:44] UpdateDatabase: Failed to run database update script.
    Need some help plz

    dahlholm,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Visit http://www.novell.com/support and search the knowledgebase and/or check all
    the other self support options and support programs available.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://forums.novell.com)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://forums.novell.com/faq.php
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Forums Team
    http://forums.novell.com

  • Trouble using Run Shell Script with python in Automator

    Hi. I have a python script I want to run in Automator (update_puzzles.py). All it does is check, rearrange and update files and there is not supposed to be any input. I can get the script to run outside of Automator, in Terminal, by navigating to the right directory and typing "python update_puzzles.py"
    I must not be setting up Run Shell Script correctly. I have it set to /bin/bash and Pass Input to stdin. The command line simply reads python /pathname/update_puzzles.py (where pathname is the path to the .py file, which I got by dragging the file onto the Run Shell Script command window). There are no actions before this in my workflow and the action after is View Results.
    The log says Run Shell Script failed, and the error is "Traceback (most recent call last):"
    Any suggestions?
    Thanks so much.

    If the script is expecting to do stuff with files in the same directory as the executable, you will probably need to add a statement to change to the appropriate working directory. The shell used in the Automator *Run Shell Script* action is a generic one that does not share any of the environment variables that the Terminal uses.

Maybe you are looking for