Re: Another Weird AppleScript-ObjC Problem
Re: Another Weird AppleScript-ObjC Problem
- Subject: Re: Another Weird AppleScript-ObjC Problem
- From: Dave <email@hidden>
- Date: Tue, 17 Nov 2015 11:34:38 +0000
- X_v_e_cd: 9f02acf3016f0e16e4520235bb5c84a3
- X_v_r_cd: dcc6f3e6618f7f3b30928a2ba7195ff4
Hi Shane,
> I don't have Outlook, so it's hard to test. But why don't you add some log statements? When you use AS's log command in an Xcode project, it gets redirected to Xcode's console.
>
> Have you checked that self.pSingletonManager.pOfficeAppleScriptManager is not nil?
Yes, the AS method gets called ok - it hits’s all the “Say” commands:
on setOutlookPropertiesDictionary:(theMessageDictionary as record)
say "setOutlookPropertiesDictionary:"
set myWindowID to kMessageWindowID of theMessageDictionary as number
set myMessageID to kMessageID of theMessageDictionary
tell application "Microsoft Outlook"
say "Debug 1"
set myWindow to (get window id myWindowID)
set myMessage to (get message id myMessageID)
say "Debug 2"
set the subject of myMessage to kMessageSubject of theMessageDictionary
set the plain text content of myMessage to kMessagePlainContent of theMessageDictionary
set the content of myMessage to kMessageHTMLContent of theMessageDictionary
say "Debug 3"
set myRepipientDictionary to kMessageRecipientDictionary of theMessageDictionary
get my replaceOutlookMessageRecipientArrayWithMessageID:(myMessageID) andRecipientDictionary:(myRepipientDictionary)
say "Debug 4"
set myAttachmentsArray to kMessageAttachmentArray of theMessageDictionary
get my replaceOutlookMessageAttachmentsArrayWithMessageID:(myMessageID) andAttachmentArray:(myAttachmentsArray)
say "Debug 5"
close myWindow without saving
open message id myMessageID
say "Debug 6"
set myWindowID to my getOutlookFrontWindowID() as number
set myMessageDictionary to my getOutlookPropertiesDictionaryWithWindowID:(myWindowID)
end tell
if myMessageDictionary = missing value then
say "myMessageDictionary Missing Value"
end if
set myMessageID to kMessageID of myMessageDictionary
say "Debug 7 myMessageID: " & myMessageID
return myMessageDictionary as record
end setOutlookPropertiesDictionary:
It gets as far as:
set myMessageID to kMessageID of myMessageDictionary
say "Debug 7 myMessageID: " & myMessageID & " Class: " & class of myMessageDictionary
return myMessageDictionary as record
And myMessageDictionary is setup ok an is of type “record", but when it gets back to Objective-C land myMessageDictionary == nil. I’m wondering if its something to do with passing dictionaries between Objective-C and AS?
>
>> Is there another more reliable AS editor that I can use for this?
>
> Well (shameless plug) there is one designed expressly for this sort of thing. See my sig.
>
> --
> Shane Stanley <email@hidden>
> <www.macosxautomation.com/applescript/apps/>
Just seen this!!! You should have plugged it before, I’ve just bought a copy! Is there a quick start guide available for what I’m trying to do? Also what book(s) would you recommend for AppleScript-ObjC?
I’m just about to look at this with ScriptExplorer, I wondering if I can step through AS Code in the Debugger when the .applescript file in an XCode Project?
All the Best
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