Re: Another AppleScript-ObjC Bridge Question

2015-11-10 Thread Shane Stanley
On 10 Nov 2015, at 9:46 PM, Dave  wrote:
> 
> Just to clarify, I don’t need a “_” at all, anywhere? 

No.

> The reason I added them is because in uses them in the example at:

That's pre-10.9 syntax. Open Script Editor, and enter the code you see there:

on square_(aNumber)
   return aNumber ^ 2
end square_

Now compile and it will end up as:

on square:aNumber
return aNumber ^ 2
end square:

Same thing, different syntax.

(And you should always use Open with External Editor so you can edit and 
compile your code outside Xcode -- if you don't, you won't catch things like 
terminology clashes.)

See the section on handlers in the AppleScript Language Guide.


-- 
Shane Stanley 



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Another AppleScript-ObjC Bridge Question

2015-11-10 Thread Dave
Hi Again Shane,

Got it now, thanks a lot for this.

All the Best
Dave

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Another AppleScript-ObjC Bridge Question

2015-11-10 Thread Dave
Thanks Shane,

Just to clarify, I don’t need a “_” at all, anywhere? 

The reason I added them is because in uses them in the example at:

http://appscript.sourceforge.net/asoc.html 


Thanks a Lot and All the Best
Dave

> On 9 Nov 2015, at 22:47, Shane Stanley  wrote:
> 
> On 10 Nov 2015, at 1:47 AM, Dave  wrote:
>> 
>> Got it working now, tt seems you don’t need the “_” after the name for init? 
>> 
>> Are the rules for when you need a “_” or not documented anywhere?
> 
> You don't need -- and in fact cannot use -- an underscore anywhere. The 
> doThis:withThat: interleaved syntax was introduced to AppleScript in 10.9; 
> before that, you would use doThis_andThat_() (which is what happens under the 
> hood, and can still be used). But never an underscore where there is no 
> parameter.
> 
> -- 
> Shane Stanley 
> 
> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/dave%40looktowindward.com
> 
> This email sent to d...@looktowindward.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Another AppleScript-ObjC Bridge Question

2015-11-09 Thread Dave
Hi,

Got it working now, tt seems you don’t need the “_” after the name for init? 

Are the rules for when you need a “_” or not documented anywhere?

All the Best
Dave


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Another AppleScript-ObjC Bridge Question

2015-11-09 Thread Dave
I’m trying to override init_ in using an AppleScript-ObjC Class, here is my 
code:

on init_()
continue init_()

display dialog "HELLO WORLD"

testOutlookAgain_("Hello") of me

-- Add your subclass-specific initialization here.
-- If an error occurs here, return missing value.

return me
end init_




on initWithBundleAppID_(theBindleAppID)

init_() of me

testOutlookAgain_("Hello") of me

-- Add your subclass-specific initialization here.
-- If an error occurs here, return missing value.

return me
end initWithBundleAppID_


But init doesn’t seem to get called. Should I have the “_” after the method 
name or not? I’ve tried both methods but it still doesn’t seem to call init_ or 
at least my AppleScript version of init…..

All the Best
Dave


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Another AppleScript-ObjC Bridge Question

2015-11-09 Thread Shane Stanley
On 10 Nov 2015, at 1:47 AM, Dave  wrote:
> 
> Got it working now, tt seems you don’t need the “_” after the name for init? 
> 
> Are the rules for when you need a “_” or not documented anywhere?

You don't need -- and in fact cannot use -- an underscore anywhere. The 
doThis:withThat: interleaved syntax was introduced to AppleScript in 10.9; 
before that, you would use doThis_andThat_() (which is what happens under the 
hood, and can still be used). But never an underscore where there is no 
parameter.

-- 
Shane Stanley 



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com