Initializing NSStatusBar item in ASOC

Since Yosemite came out I’m getting an error when trying to initialize a new item in the NSStatusBar. The code has worked well since 10.6 but is suddenly problematic. The following line gets the following error:

set theStatusItem to current application's NSStatusBar's systemStatusBar()'s statusItemWithLength_(current application's NSVariableStatusItemLength)'s retain()

ERROR:
<NSAppleEventDescriptor: 'obj '{ ‘form’:‘usrp’, ‘want’:‘prop’, ‘seld’:‘utxt’(“NSVariableStatusItemLength”), ‘from’:null() }> could not be coerced to type d. (error -10000)

Anyone else run into this and have any hints? Thanks.

For some reason NSVariableStatusItemLength has been changed from an enum to being defined in a pre-processor macro. Just use -1 instead.

I ran into that problem the other day and did just that. Thanks for confirming I was not doing anything stupid… :slight_smile: