PDA

View Full Version : Applescript Question - Probably Basic




HuggerMugger
Nov 5, 2009, 10:41 PM
Hey guys,

I was looking for some help on a simple AppleScript.

I've used Automater to create a simple application to make an application (iBank) sync the devices. I need an Applescript that I can open at startup and will run the ibanksync.app (the one I created) every 30 minutes.

Help :)



gocardsfan1
Nov 6, 2009, 10:00 AM
Wouldn't this work?

repeat
tell "ibanksync.app"
activate
delay 60 * 30
end tell
end repeat

HuggerMugger
Nov 7, 2009, 11:27 PM
It isn't working;

I get this error;

gocardsfan1
Nov 8, 2009, 11:08 PM
The automator application can probably be avoided, with the whole code being in applescript. If you tell me what the ibanksync.app consists of (a screenshot of the automator window would be great) then I could put that in the applescript code itself and then it should work. I think the problem right now is that ibanksync.app does not act like a true application, so applescript cannot activate it.

mysterytramp
Nov 9, 2009, 06:08 AM
It isn't working;

I get this error;

If iBank doesn't understand "activate," there's an extremely good chance that it's not "scriptable," which just means the developer hasn't included code to manipulate iBank directly.

There are workarounds.

Will iBank sync once it's run? Something like this would do the trick, then:

activate application "iBank"

If you need to then have it invoke a specific menu command, you can use System Events. Something like this might work:

tell application "System Events" to tell process "iBank" to keystroke "R" with command down

or something similar. You need to have the software to write the script for it exactly. If you can describe what it needs to do, we should be able to kludge together something for you.

mt

HuggerMugger
Nov 9, 2009, 03:53 PM
This is what I'm using;

The ibanksynclauncher is what starts the app and then repeats every 30 minutes;

the ibanksync is the app that I created using "watch me do" which

clicks on ibank on the dock
clicks file
then sync devices
then window
then minimize

I've gotten it working working fine, but would love to have a single app/script to run.

Any ideas?