Any scripting language have reference guide with class, metod, objects.
AppleScript dictionary is always useful to read.
The great thing about AppleScript its possible inside tell block to ask for properties, class, name, values, static text… So we could get reference we need to build the next block in our code.
In other words many times we do not need to lock else where to solve what we do next.
I understand its not possible to tell framework to give information… or…
With that in the mind, would it be possible to make AppleScriptObjC code to
get reference of framework to be able to know objects name, class, properties…
Less guessing or paste approach
Ex.
The output is ‘class ocid’ means Organized Crime Investigation Division :), not really…
Is there a easy way to translate ASOC to AS or a more human way to understand.
use AppleScript version "2.4"
use framework "Foundation"
property |⌘| : a reference to current application
set asocArray to |⌘|'s NSArray's arrayWithArray:{|⌘|'s NSNumber's numberWithInt:"1"}
its |class|()
--> «class ocid» id «data optr0000000060DF32AAFF7F0000»
After checking inside Shane Stanley’s Everyday AppleScriptObjC
use AppleScript version "2.4"
use framework "Foundation"
property |⌘| : a reference to current application
set asocArray to |⌘|'s NSArray's arrayWithArray:{|⌘|'s NSNumber's numberWithInt:"1"}
asocArray's className() as text
--> "__NSSingleObjectArrayI"
use AppleScript version "2.4"
use framework "Foundation"
property |⌘| : a reference to current application
set theList to {"1", "2"}
set asocArray to |⌘|'s NSArray's arrayWithArray:theList
asocArray's className() as text
--> "__NSArrayI"
Regards.