开发者

Applescript and Flash Builder

开发者 https://www.devze.com 2023-03-16 05:27 出处:网络
I\'m trying to get applescript to resize and move the windows of Flash Builder but I keep getting an error does anyone know how to get Eclipse or Flash Builder to play nicely with applescript?

I'm trying to get applescript to resize and move the windows of Flash Builder but I keep getting an error does anyone know how to get Eclipse or Flash Builder to play nicely with applescript?

For example:

tell application "Adobe Flash Builder 4.5"
    activate
    set the bounds of the first window to {-1680, 650, 0, 1050}
end tell

Returns this error:

tell application "Adobe Flash Builder 4.5"
    activate
    set bounds of window 1 to {-1680, 650, 0, 1050}
        --> error number -1708
Result:
error "Adobe Flash Builder 4.5 got an error: Can’t set bounds of window 1 to {-1680, 650, 0, 1050}." number -10006 from bounds of wi开发者_如何学编程ndow 1

or maybe there is a way to do this in bash? :)


You have two error codes at play here: -1708 and -10006.

-1708 is thrown when trying to script an application that isn't scriptable. -10006 is more generic but comes up when an object can't be set; you may not be able to set the bounds of a window via a script. Are you sure Flash Builder is actually scriptable?

Either way, bash won't help you out here. If the application doesn't support Open Scripting Architecture, there is little else you can do.


As @philipregan mentions, it's because the app isn't scriptable. To find out if an application is scriptable, follow these instructions from apple.

To determine if a particular app is scriptable, see if it has a scripting dictionary. See Opening a Scripting Dictionary.

Source

0

精彩评论

暂无评论...
验证码 换一张
取 消