Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: my class properties are not writable!



Have you tried turning on script logging to get some more info? And have you set SMApplication as the principal class in Info.plist?

BTW, unless this class does other things apart from scripting support, it is better practice to handle these keys in the application delegate. 

Christiaan

On 31 Jul 2007, at 4:46 PM, Evan Olcott wrote:

Yea, it came from a fresh launch of Script Editor too.
To be honest, this problem plagued me a few months ago, then I set it aside. Now I have to deal with it and get it solved. It's the same problem every time -- restarts and system updates etc don't seem to be the issue.

Not to say I haven't tried... :)

-ev

On Jul 31, 2007, at 9:38 AM, Christiaan Hofman wrote:

This looks good to me. Have you restarted Script Editor?

Christiaan

On 31 Jul 2007, at 4:27 PM, Evan Olcott wrote:

Hi everyone!

I'm having a problem with my app/my sdef/AppleScript that I have been staring at 7 ways to Sunday and just can't seem to figure out what's wrong and where else to look...

The setup:
an applescriptable application (Sample Manager) with all sorts of commands and properties. The commands are working fine. However the properties of the app, no matter what I do, are always showing up in Script Editor as non-writable.

the .sdef
===
<!-- Classes -->
<class name="application" code="capp" description="The Sample Manager application.">
<cocoa class="SMApplication"/>
...
<property name="undo enabled" code="UNDO" description="Is undo enabled?" type="boolean">
<cocoa key="undoEnabled"/>
</property>
===

the cocoa code (in the implementation for SMApplication)
===
- (BOOL)undoEnabled
{
return [[NSUserDefaults standardUserDefaults] boolForKey:@"Undo Enabled"];
}

- (void)setUndoEnabled:(BOOL)s
{
[[NSUserDefaults standardUserDefaults] setBool:s forKey:@"Undo Enabled"];
}


the script
===
tell application "Sample Manager"
set undo enabled to true
end tell

when I click "run", I get this error:
"Sample Manager got an error: The parameter is not writable."

Now, I could be picky and assume the error is saying I'm using the wrong thing: "the PARAMETER is not writable", when I'm actually trying to change a PROPERTY. But I can't tell if that's a clue or not.

Can anyone tell me where else to look to fix up the writable attribute for my app properties?

Thanks a bunch in advance!




Ev
Technical Knowledge Officer
Head Programmer/Designer
Audiofile Engineering





 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-implementors mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


Ev
Technical Knowledge Officer
Head Programmer/Designer
Audiofile Engineering






 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-implementors mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-implementors/email@hidden

This email sent to email@hidden

References: 
 >my class properties are not writable! (From: Evan Olcott <email@hidden>)
 >Re: my class properties are not writable! (From: Evan Olcott <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.