App behavior via script different when display is asleep

47 Views Asked by At

I have an AppleScript that runs every morning and evening. It tells Quicken (Mac) to update all accounts.

I have to do this because Fidelity has some private funds and the only way to get daily stock prices for them is to actually update the account.

My script runs perfectly via a shell script that is executed by launchd, provided that the display is not asleep. When the display is asleep, the script runs without error, but Quicken does not update.

Note: My Mac is set to prevent the computer from sleeping when the display is asleep.

AppleScript:

tell application "Quicken"
    reopen
    activate
end tell

tell application "System Events"
    keystroke "U" using {command down, shift down}
    delay 1
    set visible of application process "Quicken" to false
end tell

Command in .sh script:

/usr/bin/osascript /xxx/bin/Stocks/scripts/QuickenUpdate.scpt 2>&1

Anyone know why it won't update when the display is asleep ? Possible other causes for the behavior ?

Thanks.

0

There are 0 best solutions below