Re: AppleScripting
- From: matt@xxxxxxxxxxx (matt neuburg)
- Date: Thu, 02 Jun 2005 14:14:13 GMT
Paul Berkowitz <berkowit@xxxxxxxxxxxxxxxx> wrote:
> On 6/1/05 6:19 PM, in article
> 1117675173.516586.41780@xxxxxxxxxxxxxxxxxxxxxxxxxxxx,
> "renaissanceboy@xxxxxxxxxxx" <renaissanceboy@xxxxxxxxxxx> wrote:
>
> > I'm a beginner AppleScript programmer, and I'm looking for a way to
> > write a script that will do something really simple, but for some
> > reason, i can't get it to work. I need a command that opens the Labels
> > tool in Word. I can't get the command that appears in the Word 2004
> > AppleScript Dictionary to work, but this might be because I'm not that
> > good at reading the dictionaries, I'm really confused by them. If
> > anyone either knows of another way of doing this rather than using that
> > command, or can help me understand how I should use that command, I'd
> > really appreciate it.
>
> You just want to open the labels dialog, or you want to actually _do_
> something? Applescript is at its best if you just tell it to do things
> behind the scenes without opening dialogs - it can probably do anything you
> want. But it should be able to open the dialog too, if that's really all you
> want.
try
with timeout of 1 second
tell application "Microsoft Word"
activate
display Word dialog (get dialog dialog tools create labels)
end tell
end timeout
end try
Pretty hacky but it was the best I could come up with. The problem is
that "display Word dialog" waits for the user to interact with the
dialog. So to stop the script from waiting I introduced a deliberate
short timeout, along with a try block to catch the resulting "error".
As Paul says, it's hard to understand why anyone would actually want to
do this. m.
--
matt neuburg, phd = matt@xxxxxxxxxxx, http://www.tidbits.com/matt/
Tiger - http://www.takecontrolbooks.com/tiger-customizing.html
AppleScript - http://www.amazon.com/exec/obidos/ASIN/0596005571
Read TidBITS! It's free and smart. http://www.tidbits.com
.
- Follow-Ups:
- Re: AppleScripting
- From: Ritika Pathak [MSFT]
- Re: AppleScripting
- References:
- AppleScripting
- From: renaissanceboy@xxxxxxxxxxx
- Re: AppleScripting
- From: Paul Berkowitz
- AppleScripting
- Prev by Date: Re: Word Autotext and Entourage contacts
- Next by Date: Re: Word and Excel Font Optimization Problems
- Previous by thread: Re: AppleScripting
- Next by thread: Re: AppleScripting
- Index(es):
Relevant Pages
|