Re: AppleScript-ObjC Bridge Question
Re: AppleScript-ObjC Bridge Question
- Subject: Re: AppleScript-ObjC Bridge Question
- From: Dave <email@hidden>
- Date: Fri, 30 Oct 2015 15:40:12 +0000
Well, obviously it does get called, but how do you actually define in is AppleScript? I mean what is the equivalent of:
-(id) init
{
self = [super init];
if (self == nil)
return nil;
[self doSomething];
return self;
}
In AppleScript?
All the Best
Dave
> On 30 Oct 2015, at 09:46, Dave <email@hidden> wrote:
>
> Hi,
>
> This is a normal Objective-C type project but calls to AppleScript files as per http://appscript.sourceforge.net/asoc.html here is an example:
>
> LTWAppleScriptHandlerOutlook.h file:
>
> @interface LTWAppleScriptHandlerOutlook : NSObject
> {
> }
>
> -(NSString*) testOutlook:(NSString*) theNameString;
> -(NSString*) testOutlookAgain:(NSString*) theNameString;
>
> @end
> *****************************************************************************************************************
> LTWAppleScriptHandlerOutlook.applescript File
>
>
> script LTWAppleScriptHandlerOutlook
>
> property parent : class "NSObject"
>
> on testOutlook_(theName)
> local myString
>
> tell application "Microsoft Outlook"
>
> activate
> set myString to the name of window 1
> set myString to "Hello " & myString
>
> end tell
>
> return myString
> end testOutlook_
>
>
> on testOutlookAgain_(theName)
> local myString
>
> tell application "Microsoft Outlook"
>
> activate
> set myString to the name of window 1
> set myString to "Hello Again " & myString
>
> end tell
>
> return myString
> end testOutlook_
>
> end script
>
>
> I can’t seem to find any other documentation on this and was wondering if init would get called if I defined it, when I execute the following:
>
> Class myOutlookTestClass;
> LTWAppleScriptHandlerOutlook* myOutlookTest;
>
> myOutlookTestClass = NSClassFromString(@“ LTWAppleScriptHandlerOutlook”);
> myOutlookTest = [[myOutlookTestClass alloc] init];
>
>
> All the Best
> Dave
>
>
>
>
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> 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:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden