"giving up after" doesn't work anymore in Indesign (Mavericks)

Hi :slight_smile:

Lots of “doesn’t work anymore with Mavericks”. One more here :frowning:

I use a script in Indesign with a lot of “display dialog” that are supposed to “give up after” a lapse of time. This script used to work perfectly with Indesign CS6 under Lion. Now, under Mavericks, my “dialogs” don’t “give up” anymore : I have to stay in front of the screen and click “OK” every time one dialog appears.
This occurs ONLY in Indesign. If I launch the same script from “Applescript editor”, then it works.
I’ve allowed EVERY apps (CoreServices, etc. included) present on my mac in the privacy panel of system preferences, but nothing changed.
Here is a little sample of my script where the “giving up after” fails when launched from Indesign :

dialog("Vérification/création des dossiers.", "1")
set dossPSs to makeFolder("Fichiers .ps", path to desktop)
set dossBD to makeFolder("BD", dossPSs) as text
set dossHD to makeFolder("HD", dossPSs) as text

on dialog(theStatus, casDialog)
    if casDialog = "1" then
        display dialog theStatus buttons {"OK"} default button "OK" giving up after 2
.
    end if
    return button returned of result
end dialog

on makeFolder(theName, theOutputFolder)
    tell application "Finder"
        if (folder theName of theOutputFolder exists) = false then
            set theFolder to make new folder at theOutputFolder with properties {name:theName}
            set dialogCrea to 1
        else
            set theFolder to folder theName of theOutputFolder
            set dialogCrea to 0
        end if
    end tell
    return theFolder
end makeFolder

Thanks in advance if someone could help me :wink:

FWIW, if you’re using dialogs for status messages, you might consider using notifications instead.

Thank you very much Shane !

I didn’t even think using “display notification” because I mostly use this script on macs running Lion (10.7). But for those running Mavericks and Mountain Lion, your suggestion is heaven :slight_smile:

Another option (on Mavericks at least) is this:

tell application "Adobe InDesign CS6"
	tell application "SystemUIServer"
		display dialog "x" giving up after 2
	end tell
end tell

But the advantage of notifications is that you don’t waste processing time.

Yet another option for Mavericks is to use an ASObjC-based progress dialog. There’s code for one among the samples for download on my ASObjC Explorer page.

It is obvious that the script is faster now on the Macs running Mavericks and Mountain Lion :slight_smile:

. And now, using your ASObjC Runner, the script is much more “elegant” on the Macs still running Lion ! :smiley:

Shane, thank you VERY much for your precious help !

The new display notification command looks great.

I have just added some notifications to an old script, and they display when I run the script in Script Debugger 4.5 but not when I run the stand alone script.app file. I opened and resaved the script in Applescript Editor and the notification works. FYI, maybe this will help someone stuck like I was.


on run
	
	display notification "directParamText" with title "withTitleText" subtitle "subtitleText"

	display dialog "sanity check"

end