Trouble using completion

asobjc

(Mitchell L Model) #1

I have so much trouble using code completion, especially with AsObjC, that I hardly ever try to use it. This is a real loss. I have watched the ApplescriptObjC Code Completion quite a few times, but I still never get completion to work. I have all options checked in my Editor Preferences. I have use Framework "Foundation" at the beginning of my script. I type NSFileM then Escape, and nothing happens. I type NSString str and hit escape and get:

which of course is missing many messages (I was looking for stringWithString.) And I haven’t ever gotten the automatic insertion of current application's to work.

I realize that there is no information here. I am just hoping that I can get some guesses about what is going on in my SD environment.


(Shane Stanley) #2

The short story: terminology is not available until you have compiled your script with a suitable use framework statement.


(Mitchell L Model) #3

Oh yeah. Forgot about that. Thanks.

Once the code says something like current application's NSString is there a way to select that and have SD turn it into a property?


(Shane Stanley) #4

You can have Script Debugger insert properties as you type by going to Preferences and checking Editor -> Use properties for Cocoa terms in completion, or go to the Edit menu and choose AppleScriptObjC -> Use Properties for Cocoa Terms.

To change existing code from one version to another, go to the Edit menu and choose the appropriate command from the AppleScriptObjC submenu (after compiling).