|
|
Simple AppleScript Help Please
|
|
|
|
Mac Elite
Join Date: Feb 2001
Location: Sitting in front of computer
Status:
Offline
|
|
Ok, been trying to do some GUI scripting of a Java app (dMSN), but failing.
Using UI Browser from prefab i can activate what i need from within that app, but cant seem to transfer that into an applescript.
UI Browser gives me
Code:
application "dMSN"
window "dMSN Messenger" (1)
menu bar 1
menu "MSN" (1)
menu "Change status" (1)
menu item "Online" (1)
and
Code:
pick menu item "Online" of menu "Change status" of menu "MSN" of menu bar 1 of window "dMSN Messenger"
although when i try and put this into an applescript i jsut get errors. Any help appreciated
revs
|
I free'd my mind... now it won't come back.
|
|
|
|
|
|
|
|
Senior User
Join Date: Oct 2000
Location: Midwest
Status:
Offline
|
|
You need to look at the example UI scripts that are installed in /Library/Scripts. You first activate the application you want to try to script, then tell System events, fianlly tell the process you activated.
The sample scripts cover several different GUI situations and are easy to follow. If you are new to Applescript, I would not start with UI scripting, though. FWIW.
Craig
(
Last edited by suthercd; Jun 22, 2004 at 10:30 PM.
)
|
|
|
|
|
|
|
|
|
Professional Poster
Join Date: Oct 2001
Location: London
Status:
Offline
|
|
Something link this:
[php]
tell application "System Events"
tell process "dMSN"
tell window "dMSN Messenger"
tell menu bar 1
tell menu "MSN"
tell menu "Change status"
select menu item "Online"
end tell
end tell
end tell
end tell
end tell
end tell
[/php]
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Feb 2001
Location: Sitting in front of computer
Status:
Offline
|
|
I've been through the example scrips and such, and tried many things. And just ger the error:
"System Events got an error: NSReceiverEvaluationScriptError: 4"
|
I free'd my mind... now it won't come back.
|
|
|
|
|
|
|
|
Professional Poster
Join Date: Oct 2001
Location: London
Status:
Offline
|
|
I just downloaded dMSN and gave it a go - It didn't work at all here either - perhaps UI scripting doesn't work too well with Java..
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Feb 2001
Location: Sitting in front of computer
Status:
Offline
|
|
thats what i thought. Although PreFab I Browser does seem to be able to perform the actions, just doesnt work when put in an apple script.. ah well nevermind, may just ask the developer to add basic applescript support.
cheers
|
I free'd my mind... now it won't come back.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|