• 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
AppleScriptObjC Problem?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AppleScriptObjC Problem?


  • Subject: AppleScriptObjC Problem?
  • From: Dave <email@hidden>
  • Date: Wed, 11 Nov 2015 16:15:15 +0000
  • X_v_e_cd: d10ac27f831827bbe198512a2e426e13
  • X_v_r_cd: 6f33fcb32689f622df9e52bd696c0011

I posted this to the Cocoa List too, but someone here might be able to see what’s wrong?


Hi,

I’m using the AppleScript-ObjC Bridge to call an AppleScript from an XCode Objective-C project. This is the handler I am calling:

	on getOutlookMessagePropertiesDictionaryWithMessageID:(theMessageIDString)
		set myDictionary to the pMessageDictionary of me
		set myMessageID to theMessageIDString as number

—
—  Statements commented out for debugging
--

		return myDictionary
	end getOutlookMessagePropertiesDictionaryWithMessageID:

This is giving an error on the:

		set myMessageID to theMessageIDString as number

I tried calling the handler from an AppleScript in the Script Editor and it runs ok, but it fails in the App. If I comment this line out, it runs ok.

Any ideas on what could be causing it fail? I am passing an NSString into the method and it definitely numeric at the log shows:

Printing description of theMessageIDString:
540


I tried adding the following:

	try
		set myMessageID to theMessageIDString as number

		on error errorMessage number errorNumber
			say errorNumber
			say errorMessage
			return "getOutlookMessagePropertiesDictionaryWithMessageID  - Error Message ID: " & theMessageIDString
		end try

But I don’t get an error? Really confused as it what is going on with this seemingly simple Script and not sure how to debug it, any help greatly appreciated.


Thanks a lot
Dave
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden


  • Follow-Ups:
    • Re: AppleScriptObjC Problem?
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: Setting a New Field in a Record?
  • Next by Date: Re: Setting a New Field in a Record?
  • Previous by thread: Re: Setting a New Field in a Record?
  • Next by thread: Re: AppleScriptObjC Problem?
  • Index(es):
    • Date
    • Thread