AppleScriptObjC reference...

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 :slight_smile:

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.

Trying not to sound like a shill, but the best approach is to use Script Debugger, because it shows Cocoa values in a more appropriate form where possible.

I thought you will say this… (I read your message from 2016) and I guess its still true today.

I have testing to do this… its a fast way to get fast information.

And every extentions of .bridgesupport

Here is other

And every time I have the opportunity to make notes I do, slowly I learn something I guess. :slight_smile:

Cocoa Scripting book is in progress (in Japanese). It seems easy to translate it in English.
Most of the contents is figures. So, not so language independent.

How about this?


I would be interested if its in English… also if you could provide a sample of your book.

Everything I do on my computer is English, and that rule I couldn’t change.

Tell me more about it or link…

Regards.