New versions of Dialog Toolkit

I don’t see it here, although the service fails with a message Can't ... because <app name> is not showing the main dialog. I suspect switching from full-screen to no-full-screen is just something GUI scripting needs to take extra care for.

I don’t see any simple solution…

Many thanks.

I’ve often had that error but not for a while – perhaps because I’ve granted Safari assistive access or have rewritten my service – I’ve found it hard to tell why such errors appear then not appear.

The blinking might be a symptom but my main problem is I need to set the value in a text box of my app.

I’ve done more work on the service. This code switches from Safari to my app without errors but, doesn’t set the value in the text box if it starts with Safari in full screen mode. When Safari is not in full screen, it does set the value.

 	tell application "System Events"
		set value of text field 1 of window of process MyAppName to "Just testing"
		delay 1
		tell process MyAppName
			set visible to true   --  in case being hidden is a factor
			set frontmost to true
		end tell
	end tell

I set the value in the text box before switching as it didn’t work when done after. Maybe either way will work if I understand the underlying problem.

It’s been very frustrating as sometimes it works and I can’t figure out what was different. Anyway, I doubt it’s the Toolkit so, I’ll look further afield.

Cheers.

I might have a solution/kludge – it’s just a crude exiting from full screen before switching and GUI scripting:

	tell application "System Events"
		tell process Safari
			tell front window
				set value of attribute "AXFullScreen" to false
			end tell
		end tell
		delay 1
		tell process MyappName
			set visible to true
			set frontmost to true
		end tell
		set value of text field 1 of window of process MyappName to "Just testing"
	end tell

I had this idea earlier today but it didn’t work. So far, it has been working on 10.14. I’ll start testing in 10.13.

Cheers.

@Garry: To post code, just precede and it by three tickmarks on a line, and the same at the end. I’ve edited your posts above.

Many thanks, sorry for not doing that.

By the way, my final code is flakey although it still works – sometimes, Safari stays in full screen and just switches to my app.

I noticed a couple of days ago that interrogating AXFullScreen sometimes reported false even though Safari was in full screen. Maybe there are bugs in there. I’ve Googled like mad without luck to try to find other reports on that. Documentation on AXFullScreen is hard to find - can’t find anything on the Apple Developer site.

Version 1.1.1 is now available here:

https://www.macosxautomation.com/applescript/apps/Script_Libs.html

it fixes a bug where the wrong button name was returned from enhanced alerts.

1 Like

@ShaneStanley, I want to thank you for offering this fantastic utility.

I have written a dialog box with about 60 control variables (17 checkboxes, 5 fields, 5 matrix controls each with 2 options, 2 popup and their related control labels and 20+ pure labels and rules ) for setting the external preferences (I only need to load this dialog occasionally) of a script. It takes 1 sec+ to load in SD (perfectly fine response time) but as long as 4-5 secs (not every time) to popup when it is loaded as a user script on a 32GB 8-core Xeon system. I wonder if there is any general rules to improve the loading time by not having to reduce the number of controls?

Thank you very much!

Are you running it as an app, or how?

Running as a script, being placed in the application’s script menu of Devonthink V3. I don’t think this is an issue related to Dialog Toolkit at all because the dialog also opens fast from the Apple script folder. That’s why I wonder whether there are general tips for overall performance improvement - I’m now reducing the number of unnecessary label-only and rule controls to see if that helps.

Thanks again.

This works great! Thanks.

Any chance there is a version of this that works with a url vs a locally stored image?

The image is going to have to be downloaded first.

1 Like

Just a little documentation/samples feedback:

I never really used Dialog Toolkit, so I’m starting with Dialog Toolkit Plus.

But it seems that the documentation, and especially the script samples, are incomplete.

It looks like the sample scripts mostly cover the differences between Dialog Toolkit and Dialog Toolkit Plus, but not the basic function of all the commands and elements. For that, you would need the samples that came with Dialog Toolkit. But, that’s not available on the page anymore. Just Dialog Toolkit Plus.

Or am I missing something?

I found an old copy of Dialog Toolkit that I’d downloaded a while back and it seems like the samples there have everything I was looking for.

Can you tell me what scripts you’re seeing in Dialog Toolkit and not Dialog Toolkit Plus? I just downloaded it to check, and I don’t see any missing.

Odd, just downloaded again and they’re all there. Nevermind

Hi, new user here. I am having trouble figuring out where to download the latest Dialog Toolkit / Toolkit Plus.

All the links on this thread are broken.

Is there a repository somewhere?

thank you!

The page seems to have moved here:

But I’m just a visitor, and I may be pointing in the direction.

Thank you, this wave very helpful!

But I guess I’m still a bit confused. Is there a Dialog Toolkit 2.0 coming? That was the initial discussion in this thread, right?

I’m on Mojave and the Dialog Toolkit seems to run (just ran the demo scripts). By “older” you mean anything pre Big Sur?

Not at this stage. The page above will always carry links to the latest version.

I am a bit confused because on the page linked it says “Dialog Toolkit v1.1.2”, but when I download the scptd file and open it in Applescript it says “-- Version 1.1.0. Based on ‘Dialog Toolkit.scptd’.”

Seems like it is indeed a later version, I think, because the date is 2019. But thought I should explain my confusion.

Yes, that old comment is misleading — I’ll remove it in future. The actual version number is what appears via Get Info in the Finder.