2013-08-31 21 views
0

我在我的應用程序委託類中使用'newScriptingObjectOfClass ...'方法以適應核心數據。我可以'容器'元素的'水平'就好了,但是我不知道如何用它自己的元素'製作'元素。爲了創建一個新的「單元」 - 「層次」的一個要素 - 我必須回顧一下包含循環邏輯的「層次」。如何使用自己的元素之一提供AppleScript支持'make new'

下面是創建我的新關卡的正確方法,但'make'命令沒有提供術語'element'作爲'level'元素的參數術語'unit'。

tell application "SpellAnalysis" 

    make new level with make new element unit 

end tell 

這裏就是我的「sdef」文件顯示:

level n : Application levels collection

elements contains units; contained by application.

unit n [inh. level] : Level's unit collection syn unit

elements contains sections; contained by levels.

另外值得一提的是,我的KVC方法永遠不會從「newScriptObjectClass ......」的方法調用時,我成功地使一個新的「等級」(沒有包含 '單位'):

- (void)insertObject:(id)entry inLevelObjectsAtIndex:(NSUInteger)index {} 

回答

0

這編譯對我來說:

tell application "SpellAnalysis" 

    ((make new level with «class») make new element with unit) // syntax 1 

    ((make new level in class) make new unit with element) // syntax 2 

末告訴

end tell 

你可能需要調整有點,但是這對語法的總體思路。當我嘗試你的例子,我得到了:

'expected 「into」, variable name, class name, other parameter name or property but found command name.'

+0

謝謝,喬,爲您的迴應。那裏不會有很多人願意涉足AppleScript支持的深奧主題。我嘗試了許多變體的建議AppleScript命令,沒有什麼效果。我最好的嘗試是:告訴應用程序「SpellAnalysis」 \t \t集thisLevel,以與性能的新水平{級別數:1} \t \t做出新的單位thisLevel與性能{單位數:1} \t 年底告訴 – Antony

+0

我不斷收到AS錯誤消息:錯誤「SpellAnalysis得到一個錯誤:無效的密鑰形式。」在這一點上,我認爲我的教學法或者我的課程被指定的方式肯定有問題。 – Antony

相關問題