When I started using AppleScriptObjC years ago, a commonly used way to refer to Cocoa classes was the following:
property NSString : class "NSString"
property NSFileManager : class "NSFileManager"
That’s the method I’m still using and it works with no issues, as far as I can tell.
However, these days all I see in code examples is this:
property NSString : reference to current application's NSString
property NSFileManager : reference to current application's NSFileManager
I prefer the class "ClassName"
approach for brevity sake.
But I started wondering if I’m missing something and if there are any pitfalls or potential disadvantages in this approach?
I looked through Apple’s docs on the subject - but, frankly, I couldn’t understand if there’s any difference in practical terms: Mac Automation Scripting Guide: Objective-C to AppleScript Quick Translation Guide
Like I mentioned, class "ClassName"
seems to work for me in any situation.
If anyone has any insights on this or case scenarios where these two approaches are not interchangeable, it will be appreciated!