InDesign Dialog Not Showing

I’m told that InDesign AppleScripts that worked a year or so ago are now having this problem: dialogs don’t appear, the “show” command just returns immediately with a “Cancel button was hit” status. If I remember correctly, we ran CS then and are now under CS2, if that’s significant.

I’ve taken this script pretty much verbatim from the InDesign script user’s guide:

tell application "Adobe InDesign CS2"
	set myDialog to make dialog with properties {name:"Simple Dialog"}
	tell myDialog
		tell (make dialog column)
			make static text with properties {static label:"This is a very simple dialog box."}
		end tell
	end tell
	set myResult to show myDialog
	if myResult is true then
		display dialog ("You clicked the OK button")
	else
		display dialog ("You clicked the Cancel button")
	end if
end tell

and sure enough the dialog box never appears but I get the “You clicked the Cancel button” message. Can someone tell me what simple thing I’m overlooking? I’m very rusty with AppleScript so I’m sure it’s something very obvious, it’s just gotten frustrating. :frowning:

Thanks very much…

  • Dan

Well this works fine for me so I’m guessing that either through a preference or some other script your user interaction level has been set to either never interact or only with alerts. So with that said try this

tell application "Adobe InDesign CS2"
	-- other choices are never interact  &  interact with alerts (ignores dialogs)
	set user interaction level of script preferences to interact with all
	
	set myDialog to make dialog with properties {name:"Simple Dialog"}
	tell myDialog
		tell (make dialog column)
			make static text with properties {static label:"This is a very simple dialog box."}
		end tell
	end tell
	set myResult to show myDialog
	if myResult is true then
		display dialog ("You clicked the OK button")
	else
		display dialog ("You clicked the Cancel button")
	end if
end tell

Bingo! That was it…thanks very much, I should have thought of that. You’ve saved me a lot of time and trouble today. :wink:

  • Dan

Glad to be of help Dan!