Re: error with scripting bridge/sdp and microsoft word 2008
Re: error with scripting bridge/sdp and microsoft word 2008
- Subject: Re: error with scripting bridge/sdp and microsoft word 2008
- From: Matt Neuburg <email@hidden>
- Date: Tue, 16 Jun 2009 08:12:36 -0700
- Thread-topic: error with scripting bridge/sdp and microsoft word 2008
On Mon, 15 Jun 2009 20:31:38 +0530, Gokul Krishna <email@hidden> said:
>i did fix the sdef and passed it on to the sdp to get a header
>file(basically deleted the offending lines). However i am not sure if this
>will affect the script in any way.
>So was wondering if there is a better way of doing it
He told you a better way: If you must use a scripting bridge from
Objective-C, don't use Apple's Scripting Bridge, use the Objective-C version
of Appscript instead. If you do elect use Apple's Scripting Bridge you just
have to live with the fact that it doesn't understand the realities of
AppleScript dictionaries and how scriptable applications actually implement
AppleScript commands.
My own foray into the use of Scripting Bridge was very short; I tried to
implement the example in Appendix B of my book (tell app "BBEdit" to make
new document). That was when I discovered that this was impossible, because
Scripting Bridge knows nothing of the various ways in which an application
might implement "make" (i.e. the various kinds of parameter it might or
might not accept). When I asked about this on one of the lists, I was told
that Apple didn't care about legacy apps; basically, Scripting Bridge is
geared to new applications that are implemented using Cocoa Scripting.
(Microsoft Word is not one of those either.) End of story. I switched to
Appscript. Problem solved. Game over. m.
>
>On Mon, Jun 15, 2009 at 7:50 PM, Philip Aker <email@hidden> wrote:
>
>> On 2009-06-15, at 05:58:52, Gokul Krishna wrote:
>>
>> Hi,
>>>
>>> I am trying to use scripting bridge to create some documents using
>>> microsoft word 2008 from within my cocoa application.
>>>
>>> I use the following command to generate the glue code header for word
>>>
>>> sdef /Applications/Microsoft\ Office\ 2008/Microsoft\ Word.app/ | sdp -fh
>>> --basename MicrosoftWord
>>>
>>> sdp fails and prints the error message
>>>
>>> sdp: /dictionary[1]/suite[4]/enumeration[90]/enumerator[50]: missing
>>> required "name" attribute
>>>
>>> the generated header file is also incomplete and cannot be used .
>>>
>>> Any pointers on why this is happening and how to rectify it?
>>>
>>
>> Not anything concrete since I don't use that application.
>> However, maybe you can fix the generated sdef before passing it to sdp.
>> A better list for this kind of question is the AppleScript implementors
>> list.
>> Also, you may wish to check out alternate possibilities using one or
>> another of the 'appscript' family <http://appscript.sourceforge.net/> by
>> Hamish Sanderson.
>>
>> Philip Aker
>> echo email@hidden@nl | tr a-z@. p-za-o.@
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings
_______________________________________________
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