Applescript Holy Grail ?

Hi Applescript community…

Does anyone know how to ‘script’ a custom/complex user interface/dialog in Applescript. Is there any way to use the Interface Builder and AppleScript Studio to create custom dialogs without creating a separate application at the end of it… If anybody uses Appearance OSAX… can it create a full range of dialog widows with listboxes etc???

Perhaps there is an easy way to write a script and pass the information from it to an Applescript app that just contains the dialog, display the dialog and then link back to the script to continue processing… though this would add loads more complexity. I suppose what I’m looking for is Dialog Director for OSX…

Smile looks good as it can script complex user interfaces… so I thought perhaps If I write and execute my script in Smile then all would be fine… trouble is the documentation is unhelpful or rather I’m too stupid to work it out… if somebody could post me (or email me a script from smile that takes some data from an external text file and creates a dialog with a listbox in it then I’m sure I would be half way there…

Failing this does anyone know the whereabouts of Christopher Hyde ?

Cheers in advance


Hi Paul,

I posted a Smile dialog not too long ago. Try searching for it. You can easily createan AppleScript Studio dialog that returns user selection also. I think there was a way to just use IB, but have forgotten how to do that.

The Smile dialog is not too hard. You can create a dialog in Smile and drag the dialog record to a window or use the dialog. It’s in the documentation. Only problem is Smile needs to open.

Gotta go back to bed now.


I seem to remember Haanan’s book had a section on building an interface in IB to use in just this manner.


I really can’t figure out what you want when you say “script a dialog”. Do you want to control a dialog box in another program, or create your own custom dialogs? If you want to create custom interfaces, use Xcode and Interface Builder. There is nothing better on the Mac (and they’re free).


I’m using applescript to automate production in QuarkXpress and Illustrator. I just want to run the compiled script which jumps between Quark and Illustrator and displays a useful dialog box in which the user can control the process. By creating a GUI / dialog application with Applescript studio means that I have to figure out how to pass variables from my script to this app and back again… I was hoping there was a solution like dialog direcctor where I can create a custom dialog box on the fly within the code of my compiled script…Appearance OSAX sort of gets half the way there but it doesn’t handle list boxes…



I don’t see the problem here. Create a dialog in Interface Builder, gather the variables when the user clicks your “action” button (or whatever), send commands to Quark and Illustrator. Easy peasy.

Maybe this will give you some ideas.

i would have expected something a little more helpful from a forum regular! Just cause your a clever clogs and you can do it!:confused:

Well, there’s nothing more I can tell you. I can’t describe how to gather all of your data, because I don’t know what your dialog and application look like; I don’t know how to tell you to make your dialog, because I don’t know what your requirements are; and I can’t tell you jack about Quark, 'cause I use InDesign. :slight_smile:

If it’s an issue of not knowing how to get information from UI controls in AppleScript Studio, I wouldn’t know where to begin discussing how to do it, because I don’t know what this hypothetical dialog contains.

Start here:

If anyone has specific questions about AS Studio development, we have a forum for that. On the other hand, If anyone wants to wait for a magical, all purpose solution, that’s fine with me; Just don’t jump on people because they don’t give you exactly what you want.

My Apologies! to Mikey-san !My intent was not to upset or even jump on anyone, His Knowledge of applescript is far greater than mine!!!
i may have mis-interpreted his tone!:frowning:


I would like to have an interface to my compiled applescript as it is running… populate the fields of the listboxes and other starting values in the interface, get the result of the users selections and feed those back into the calling script. Pashua looks good but It doesn’t do progress bars. Smile does really good custom interfaces but I can’t figure out how to use its dialog capability to put some decent interface onto scripts designed and run from anything other than smile. I’m also dumbfounded by its syntax.

can Interface builder be used in isolation to produce a User interface that I can bolt onto my compiled scripts without having to run XCode and create a standalone Application. Yet again I’m looking for something straightforward like dialog director, but for OSX



Hi Paul,

You should just learn to make a simple AppleScript Studio application. It’s not that hard after you learn to name objects and connect the handlers. You can make it background only, so it will seem like your script opened the dialog. You can get the user selection also.

I don’t know if you searched for my posted Smile dialog, but it’s not that hard to understand. It’s similar to Dialog Director as you use records to define your dialog elements. The downside as I said is that Smile needs to open to show the dialog. Here’s the link to my example:

As I said though, AppleScript Studio is much better once you get past the initial learning curve. I’ve made dialogs that return user entries from as studio apps to my scripts.

Edited: BTW, try checking out Jon’s site. He might have an example already made:


Hi Kel,

I suppose I’ll just have to work with the hammer to crack a nut and use XCode/Applescript studio. I wanted to write and debug scripts in Script Debiugger not Xcode and just call the custom dialogs on the fly…

IF smile is so easy then how can you call/run a pogress bar dialog from an external script ?? I can’t find any decent examples anywhere and so finding smile frustrating



Paul, did you ever check out how this progress bar app is used?

The app itself doesn’t do anything, it just sits in the background; I then made a bunch of handlers to control it form other scripts (which, FWIW, I wrote in Script Editor).

Here’s a possible handler that might be useful for you (once it’s referencing the proper controls):

on generateMenuItems for someList
		tell window 1 of application "yourApplication"
			tell menu of popup button 1
				delete every menu item
				repeat with thisItem in someList
					make new menu item at the end of menu items with properties {title:thisItem}
				end repeat
			end tell
		end tell
	end try
end generateMenuItems

Hi Paul,

Here’s a simple example of progress bars. You probably don’t need all the proerties in the record, but I just left then in. The main property to change data is ‘contained data’. They changed some things in this update of Smile. This example is an idle handler and needs to be saved as stay open application. You probably know what that means if you used DD before.

using terms from application "Smile"
	property window_props : {class:dialog, name:¬
		"Progress", visible:true ¬
		, bounds:{83, 39, 333, 239} ¬
		, text font:"Lucida Grande", text size:13 ¬
		, selected rectangle:{0, 0, 0, 0}, requested user level:0 ¬
		, «class ToVi»:true, «class VaOE»:false}
	property text_props : {class:dialog item, control kind:288 ¬
		, contained data:¬
		"Counting ...", enabled:true ¬
		, bounds:{21, 28, 218, 44} ¬
		, font:{font:-1} ¬
		, call script:false}
	property prog_props : {class:dialog item ¬
		, «class size»:0, «class key »:"progress bar", control kind:80 ¬
		, enabled:true, bounds:{18, 75, 158, 92}, call script:false ¬
		, «class Auto»:false ¬
		, maximum:10, minimum:0}
end using terms from
global d, di_text, di_prog, c
on run
	tell application "Smile"
		set d to (make new dialog at front with properties window_props)
		set di_text to (make new dialog item at d with properties text_props)
		set di_prog to (make new dialog item at d with properties prog_props)
	end tell
	set c to 0
end run
on idle
	tell application "System Events" to set smile_exists to exists process "Smile"
	if smile_exists then
		set c to c + 1
			tell application "Smile"
				set contained data of di_prog to c
			end tell
			if c is 10 then
				tell application "Smile"
					set contained data of di_text to "Done"
				end tell
			end if
		on error -- no window
		end try
	else -- no Smile
	end if
	return 2
end idle
on quit
	tell application "System Events"
		set smile_exists to (exists process "Smile")
	end tell
	if smile_exists then
		tell application "Smile" to quit
	end if
	continue quit
end quit

There are other things you can do with the dialog like connect it to your app, make floating, etc., and expecially change values.


If AppleScript Studio isn’t your thing, you could also try FaceSpan. I like FaceSpan’s environment better, but I get chided all the time because AppleScript Studio is free. shrug