Hello all,
I am trying to use Shane’s excellent Dialog Toolkit Plus, but running into an issue I don’t understand. I have searched on her, looked at the documentation that came with DTP, built the dialog as instructed in DTP’s dictionary and no luck. I get an error saying “Missing Value doesn’t understand the “suppressionButton” message.” when I try to run the following code in SD or Script Editor:
set notFound to {{" apples", " Granny Smith"}, return, {" apples", " McIntosh"}}
set xCount to ((count of items of notFound))
display enhanced alert (xCount & " of the file(s) could not be processed!") message (("Here is a list of the files in question:" & return & return & notFound) as string) as critical alert ¬
buttons {"OK", "Cancel"} acc view width "640" acc view height "480" acc view controls {} without suppression
I have tried both with and without “without suppression” argument and get the same error.
I have also tried stripping down one of Shane’s example scripts but things don’t work then either (Sorry it has been a while since I attempted that, and I just remember I could not get it to work).
If I understand well the problem is that you tried to concatenate a number (xCount) to a string which builds a list when the command requires a string.
You may check what I wrote with :
use AppleScript version "2.4" -- Yosemite (10.10) or later # ADDED
use scripting additions # ADDED
use script "Dialog Toolkit Plus" version "1.1.0" # ADDED
set notFound to {{" apples", " Granny Smith"}, return, {" apples", " McIntosh"}}
set xCount to (count of items of notFound)
set beurk to (xCount & " of the file(s) could not be processed!")
--> {3, " of the file(s) could not be processed!"}
This said, try with :
use AppleScript version "2.4" -- Yosemite (10.10) or later # ADDED
use scripting additions # ADDED
use script "Dialog Toolkit Plus" version "1.1.0" # ADDED
set notFound to {{" apples", " Granny Smith"}, return, {" apples", " McIntosh"}}
set xCount to (count of items of notFound) as text # EDITED
display enhanced alert (xCount & " of the file(s) could not be processed!") message (("Here is a list of the files in question:" & return & return & notFound) as string) as critical alert ¬
buttons {"OK", "Cancel"} acc view width "640" acc view height "480" acc view controls {} without suppression
Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) lundi 17 juin 2019 23:00:17
Thanks, I would not have thought that having that variable as a number would cause the whole thing to not work. But it works now!
Thanks Yvan!