Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

beencountry

macrumors newbie
Original poster
Mar 9, 2010
2
0
Hey guys I am trying to run a script so that one of my programs will run automatically and then hide right away. The problem is, is that when the program is first booted up in order for it to work properly it needs basicaly a human interaction to hit the "OK" button. I thought I had it correct but it keeps telling me Syntax error. can Some one help me on this? I have it so that it will start and hide right away just I need help programming how to have it "click ok" This is what I have in apple script so far. Thanks for any help in advance

tell application "BackupManager" to activate
tell application "BackupManager" to activate
delay 5
tell process "AhsayOBM"
click button "OK" of window "Ahsay Online Backup Manager Logon"
delay 3
tell application "Finder"
set visible of process "AhsayOBM" to false
end tell
 
Hey guys I am trying to run a script so that one of my programs will run automatically and then hide right away. The problem is, is that when the program is first booted up in order for it to work properly it needs basicaly a human interaction to hit the "OK" button. I thought I had it correct but it keeps telling me Syntax error. can Some one help me on this? I have it so that it will start and hide right away just I need help programming how to have it "click ok" This is what I have in apple script so far. Thanks for any help in advance

tell application "BackupManager" to activate
tell application "BackupManager" to activate
delay 5
tell process "AhsayOBM"
click button "OK" of window "Ahsay Online Backup Manager Logon"
delay 3
tell application "Finder"
set visible of process "AhsayOBM" to false
end tell

I think you're going to need some GUI scripting. It'll be something like:

Code:
tell application "BackupManager" to activate
tell application "BackupManager" to activate
delay 5
tell application "System Events"
tell process "AhsayOBM" 
	click button "OK" of window "Ahsay Online Backup Manager Logon"
delay 3
end tell
end tell
tell application "Finder"
	set visible of process "AhsayOBM" to false
end tell

Because I don't have "BackupManager" it'll be difficult to give you the code precisely, but if you google "GUI Scripting" you should see some example code that will tell you how to work System Events.

mt
 
Hey Thanks MT, this helped a lot. I think the main thing I was forgetting was the [tell application "System Events"], but I got it working now thanks to your help. Just now got to figure out how to run it at start up.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.