• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: AppleScript-ObjC Bridge Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AppleScript-ObjC Bridge Question


  • Subject: Re: AppleScript-ObjC Bridge Question
  • From: Dave <email@hidden>
  • Date: Sat, 31 Oct 2015 11:37:30 +0000

Thanks a lot Shane, I totally missed it, sorry for the misunderstanding.

Cheers
Dave


> On 30 Oct 2015, at 15:40, Dave <email@hidden> wrote:
>
> 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


_______________________________________________

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


  • Follow-Ups:
    • Re: AppleScript-ObjC Bridge Question
      • From: Dave <email@hidden>
References: 
 >AppleScript-ObjC Bridge Question (From: Dave <email@hidden>)
 >Re: AppleScript-ObjC Bridge Question (From: Shane Stanley <email@hidden>)
 >Re: AppleScript-ObjC Bridge Question (From: Dave <email@hidden>)
 >Re: AppleScript-ObjC Bridge Question (From: Dave <email@hidden>)

  • Prev by Date: Re: AppleScript-ObjC Bridge Question
  • Next by Date: Re: AppleScript-ObjC Bridge Question
  • Previous by thread: Re: AppleScript-ObjC Bridge Question
  • Next by thread: Re: AppleScript-ObjC Bridge Question
  • Index(es):
    • Date
    • Thread