Re: AppleScripting

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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
.



Relevant Pages

  • Re: Command line printing
    ... through an applescript, the following script would work (this is just code ... By the way - command line is not an option. ... so that margin warnings won't stop the script. ... >> Using lpr does not work as I suspect lpr does not understand the WORD>> format. ...
    (microsoft.public.mac.office.word)
  • Re: Stopping automatic creation of blank new docs
    ... Paul Berkowitz wrote: ... there would be a property of a Document object that I could set in VB before ... But, AppleScript to the rescue. ... as Script - .scpt) in the OS Script menu (in Tiger, ...
    (microsoft.public.mac.office.word)
  • Re: Cant capture PID with script in cron
    ... > When you finish the script, post it and let's chat about it and jobs. ... # In Mac OS X the command line accepts the command "open" ... # The applescript performs a function in the Mac OS scripting language ... showing only the app name and not the path. ...
    (comp.unix.questions)
  • Mark mail as read?
    ... Edelstein aided by the excellent input from Paul Berkowitz. ... idea is that the script will tell me how many tasks, ... mails I have. ... I'm then able to get the AppleScript to read the items ...
    (microsoft.public.mac.office.entourage)
  • Re: URL dei file scaricati
    ... Forse quanto segue può essere utile? ... "Lets you turn any command line script or AppleScript into a system ...
    (it.comp.macintosh)