2011-06-27 89 views
2

我試圖讓蘋果腳本調整大小和移動Flash Builder的窗口,但我不斷收到錯誤沒有人知道如何讓Eclipse或Flash Builder與applescript很好地玩?Applescript和Flash Builder

例如:

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

返回此錯誤:

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 window 1 

也許有一種方法在bash做到這一點? :)

回答

2

您在這裏玩有兩個錯誤代碼:-1708-10006

-1708在嘗試編寫腳本化非腳本應用程序時引發。 -10006更爲通用,但在無法設置對象時出現;您可能無法通過腳本設置窗口的邊界。你確定Flash Builder實際上是可腳本化的嗎?

無論哪種方式,bash都不會幫你在這裏。如果應用程序不支持開放腳本架構,那麼您可以做的其他事情很少。

+0

那麼如何知道Eclipse或Flash Builder是否可腳本化? :) – gdoubleod

+0

@gdoubleod:在Applescript編輯器中,進入Menubar>'File'>'Open Dictionary ...'並查找應用程序。如果未列出,可以手動將編輯器指向該編輯器,但如果它不在列表中,則不可編寫腳本。 –

+0

我想這不是腳本我會稍後再試... – gdoubleod