Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: UI scripting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UI scripting




Le 11 oct. 2006 à 16:58, Ruby Madraswala a écrit :

Hi 

Any reason why this works

activate application "TextEdit"
tell application "System Events"
    tell process "TextEdit"
        tell menu bar 1
            tell menu bar item "Edit"
                click -- open Edit menu
                tell menu "Edit"
                    tell menu item "Copy"
                        click -- choose Copy command
                    end tell
                end tell
            end tell
        end tell
    end tell
end tell


And this does not. I get error message NSReceiverEvaluationScriptError:
4.
activate application "Illustrator 10.0.3"
tell application "System Events"
    tell process "Illustrator"
        tell menu bar 1
            tell menu bar item "Edit"
                click -- open Edit menu
                tell menu "Edit"
                    tell menu item "Copy"
                        click -- choose Copy command
                    end tell
                end tell
            end tell
        end tell
    end tell
end tell

I am just testing and learning UI scripting. I can get the edit/copy
keystrokes to work. What I want to do is in Illustrator - activate
Object - transform - scale.. menu using the tell block or any other
method.


Hello

Are you sure that the process is named "Illustrator"  or that the app itself is named "Illustrator 10.0.3"

you may try to add some extra tasks and look in the log report which ones are executed befure the failure.

For instance:

activate application "Illustrator 10.0.3"
tell application "System Events"
    tell process "Illustrator"
        tell menu bar 1
get name of every menu bar items
            tell menu bar item 4 --"Edit"
                click -- open Edit menu
                tell menu 1 -- "Edit"
get name of every menu items
                    tell menu item 5 --"Copy"
                        click -- choose Copy command
                    end tell
                end tell
            end tell
        end tell
    end tell
end tell


Yvan KOENIG


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >UI scripting (From: "Ruby Madraswala" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.