Automator Runner displays dialog in Sierra, not in High Sierra


#1

I have some scripts that include lines like this one:

do shell script "osascript -e 'tell application \"Automator Runner\"  to display dialog \"Word must go online to convert the intermediate file.\" & return & return & \"This message will close when Word finishes.\" buttons {\"Conversion in process…\"} with title \"WPWordConverter\" giving up after 60' &> /dev/null &"

This worked perfectly under Sierra; when I try to use this kind of thing in High Sierra, I get an error message:

Automator Runner got an error: Connection is invalid.

Probably I should use something more modern to accomplish this, but I’m trying to be compatible with older OS versions.

Is there something I can do to make this work in High Sierra? As a workaround, I’ve enclosed these lines in try/end try blocks, but that leaves the user without any visual indication of what’s going on the background. Thanks for any help.


(Shane Stanley) #2

Have you tried System Events? You shouldn’t be scripting Automator Runner.


#3

Thank you, Shane. I’m not clear on whether I can use System Events for the purposes of this script - and I think I wasted everyone’s time by not explaining why I was using Automator Runner in the first place, instead of System Events.

I use Automator Runner to display a dialog until a later point in the script (when a file gets created); at that point my script kills the Automator Runner process and the dialog closes. I couldn’t figure out any other way to make a dialog appear at one point and then close it at a specific later point in the script.

I’m trying to find something that will be compatible at least as far back as OS X 10.8, though I’m perfectly willing to give up and support only later versions if necessary.

EDIT: I suppose I should try this, but is it possible to run a second script that does nothing but display a dialog, and then kill that second script at the point where I want to close the dialog?


(Shane Stanley) #4

I understand what you’re doing — I’m just saying Automator Runner isn’t meant to be scripted like that, so you have no guarantees.

It sounds like you really want a scriptable progress bar app. You could try something like this:

http://macscripter.net/viewtopic.php?id=36409


#5

That’s exactly what I want. I found I had a copy of an older version on my disk, but used Automator Runner simply because it was easier. Thank you for the reminder.