Hi,
Why would you use class “NSDate”'s instead of NSDate’s?
Thanks,
kel
Model: MBP
AppleScript: AS 2.2.4
Browser: Safari 536.28.10
Operating System: Mac OS X (10.8)
Hi,
Why would you use class “NSDate”'s instead of NSDate’s?
Thanks,
kel
Model: MBP
AppleScript: AS 2.2.4
Browser: Safari 536.28.10
Operating System: Mac OS X (10.8)
Hi,
in terms of AppleScript NSDate is just a variable, class “NSDate” is an object reference (like application “Finder”)
Hi Stefan,
Are they always interchangeable?
Thanks,
kel
they what?
In the script, can you use either variables or object references? For instance, this:
can be exchanged with this:
Thanks,
kel
Got it. Both forms work.
You can even use (without current application)
property NSDateFormatter : class "NSDateFormatter"
set myFormatter to NSDateFormatter's alloc()'s init()
That’s what I was thinking about ‘current application’ also. I’m just trying to clean up my script.
Thanks a lot,
kel
but this does not work
set myFormatter to class "NSDateFormatter"'s alloc()'s init()
This works here:
set myFormatter to current application’s class “NSDateFormatter”'s alloc()'s init()
Don’t know if it matters but I switched everything into the applicationDidFinishLaunching handler. I think I might use ‘current application’ all the time as a rule until I get to know where it works and doesn’t work.
Thanks,
kel
I mean exactly this syntax without current application
It works all the time at the root level of the script as in the property declaration 'parent: class “NSObject”.
Thanks for all the info,
kel