I have written an application running under Mac OsX (version Logiciel OS X 10.9.5 (13F34)) and now I want to drive this app through Apple Script (version AppleScript editor: Version 2.6.1 (152.1) version AppleScript: 2.3.2)
I have validated my app as scriptable and constructed the suite within a.sdef file,
In this suite, I have in class “AppDelegate” defined an Array of object called upsArray which is defined as an array of one other class called Ups
In my script definition I have specified This AppDelegate class and properties
<class name="AppDelegate" code="SCad" description="main class in SolarMaxOsX.">
<cocoa class="AppDelegate"/>
<!-- Liste des Ups reconnus dans le fichier de configuration >-->
<property name="upsArray" code="obj " type="specifier" access="r" description="List of Ups">
<cocoa key="upsArray"/>
<type type="Ups"/>
</property>
</class>
And in my script to get this Ups Array, I have written:
tell application “/Users/guydesbief/Library/Developer/Xcode/DerivedData/SolarMaxOsX-cgcuhyptmpmt iegixfnbbhpexjhn/Build/Products/Debug/SolarMaxOsX.app” to activate
set upsArrayList to a reference to upsArray
class of upsArray
And I get the error:
tell application “SolarMaxOsX”
activate
get class of upsArray
--> error number -1728 from upsArray
first of all, all lowercase 4-letter codes are reserved by Apple, so it’s strongly recommended to use a different code.
Some other possible problems:
¢ If you provide a custom type in the SDEF file you have to define the type and implement the scriptingWithDescriptor: and scriptingDescriptor methods.
¢ the top level class in the SDEF file is “application”, the AppDelegate file is “routed” automatically
¢ The application delegate class must implement the delegateHandlesKey: method
Hi
Thanks for your answer :), i will apply every advice and I come back as soon as I have news
But it may take a few days because I have not so much time at his moment
Regards
Model: powerbook
AppleScript: AppleScript 2.3.2
Browser: Firefox 26.0
Operating System: Mac OS X (10.8)
So, you mean that you can just use ‘count someArray’ and this is not the AppleScript ‘count someList’? Or is the array being coerced to AppleScript list?
Hi
I wanted to implement the scriptingWithDescriptor: and scriptingDescriptor methods
for instance if new type is “Ups” (which is actually a Dictionary/record) for instance must I have to implement in Cocoa Ups class ?
1/
In which class must I have to implement these two methods ?
2/
I did not find any sample code for these 2 methods
Has anyone one sample ?
Thanks
Model: powerbook
AppleScript: AppleScript 2.3.2
Browser: Firefox 26.0
Operating System: Mac OS X (10.8)