As I don’t use GarageBand, I ran it once and ran the piece of code which I use when I must trigger GUIScripting.
What I got doesn’t match what you described but you may use the same kind of code to get infos allowing your script to see which pedal is active.
activate application "GarageBand"
tell application "System Events"
tell process "GarageBand"
set frontmost to true # ADDED
log (get class of UI elements)
(*window, window, menu bar*)
tell window 1
log (get its name)
(**)
log (get properties of UI elements)
(*
class:slider, minimum value:0.0, orientation:AXHorizontalOrientation, position:1389, 635, role description:curseur, accessibility description:missing value, focused:false, title:missing value, size:63, 25, value:0.120663106441, help:Zoom horizontal, enabled:true, maximum value:1.0, role:AXSlider, entire contents:, subrole:missing value, selected:missing value, name:missing value, description:curseur*)
log (get attributes of UI element 1)
(*
attribute AXEnabled of slider 1 of window 1 of application process GarageBand,
attribute AXAllowedValues of slider 1 of window 1 of application process GarageBand,
attribute AXOrientation of slider 1 of window 1 of application process GarageBand,
attribute AXParent of slider 1 of window 1 of application process GarageBand,
attribute AXSize of slider 1 of window 1 of application process GarageBand,
attribute AXFocused of slider 1 of window 1 of application process GarageBand,
attribute AXChildren of slider 1 of window 1 of application process GarageBand,
attribute AXRole of slider 1 of window 1 of application process GarageBand,
attribute AXTopLevelUIElement of slider 1 of window 1 of application process GarageBand,
attribute AXHelp of slider 1 of window 1 of application process GarageBand,
attribute AXPosition of slider 1 of window 1 of application process GarageBand,
attribute AXValue of slider 1 of window 1 of application process GarageBand,
attribute AXWindow of slider 1 of window 1 of application process GarageBand,
attribute AXRoleDescription of slider 1 of window 1 of application process GarageBand,
attribute AXMinValue of slider 1 of window 1 of application process GarageBand,
attribute AXMaxValue of slider 1 of window 1 of application process GarageBand,
attribute AXFrame of slider 1 of window 1 of application process GarageBand*)
log (get properties of attributes of UI element 1)
(*
class:attribute, value:true, settable:false, name:AXEnabled,
class:attribute, value:missing value, settable:false, name:AXAllowedValues,
class:attribute, value:AXHorizontalOrientation, settable:false, name:AXOrientation,
class:attribute, value:missing value, settable:true, name:AXParent,
class:attribute, value:63, 25, settable:false, name:AXSize,
class:attribute, value:false, settable:true, name:AXFocused,
class:attribute, value:value indicator 1 of slider 1 of window 1 of application process GarageBand, settable:false, name:AXChildren,
class:attribute, value:AXSlider, settable:false, name:AXRole, class:attribute, value:missing value, settable:false, name:AXTopLevelUIElement,
class:attribute, value:Zoom horizontal, settable:false, name:AXHelp,
class:attribute, value:850, 113, settable:false, name:AXPosition,
class:attribute, value:0.180662930012, settable:true, name:AXValue,
class:attribute, value:window 1 of application process GarageBand, settable:false, name:AXWindow,
class:attribute, value:curseur, settable:false, name:AXRoleDescription,
class:attribute, value:0.0, settable:false, name:AXMinValue,
class:attribute, value:1.0, settable:false, name:AXMaxValue,
class:attribute, value:850, 113, 913, 138, settable:false, name:AXFrame*)
--click button 4
end tell
tell window 2
log (get its name)
(*Sans Nom - Pistes*)
log (get properties of UI elements)
(*class:button, minimum value:missing value, orientation:missing value, position:-521, 26, role description:Bouton de fermeture, accessibility description:missing value, focused:false, title:missing value, size:14, 16, value:missing value, help:missing value, enabled:true, maximum value:missing value, role:AXButton, entire contents:, subrole:AXCloseButton, selected:missing value, name:missing value, description:Bouton de fermeture,
class:button, minimum value:missing value, orientation:missing value, position:-481, 26, role description:bouton plein écran, accessibility description:missing value, focused:false, title:missing value, size:14, 16, value:missing value, help:ce bouton peut également agrandir ou réduire la fenêtre, enabled:true, maximum value:missing value, role:AXButton, entire contents:, subrole:AXFullScreenButton, selected:missing value, name:missing value, description:bouton plein écran,
class:button, minimum value:missing value, orientation:missing value, position:-501, 26, role description:Bouton de placement dans le Dock, accessibility description:missing value, focused:false, title:missing value, size:14, 16, value:missing value, help:missing value, enabled:true, maximum value:missing value, role:AXButton, entire contents:, subrole:AXMinimizeButton, selected:missing value, name:missing value, description:Bouton de placement dans le Dock,
class:image, minimum value:missing value, orientation:missing value, position:139, 26, role description:image, accessibility description:missing value, focused:false, title:Sans Nom.band, size:16, 16, value:missing value, help:missing value, enabled:true, maximum value:missing value, role:AXImage, entire contents:, subrole:missing value, selected:missing value, name:Sans Nom.band, description:image,
class:static text, minimum value:missing value, orientation:missing value, position:157, 25, role description:texte, accessibility description:missing value, focused:false, title:missing value, size:119, 17, value:Sans Nom - Pistes, help:missing value, enabled:true, maximum value:missing value, role:AXStaticText, entire contents:, subrole:missing value, selected:missing value, name:Sans Nom - Pistes, description:texte,
class:group, minimum value:missing value, orientation:missing value, position:-509, 49, role description:barre d'outils, accessibility description:Barre des commandes, focused:false, title:missing value, size:1433, 48, value:missing value, help:missing value, enabled:missing value, maximum value:missing value, role:AXGroup, entire contents:, subrole:missing value, selected:missing value, name:missing value, description:Barre des commandes,
class:group, minimum value:missing value, orientation:missing value, position:-513, 107, role description:groupe, accessibility description:missing value, focused:false, title:missing value, size:382, 939, value:missing value, help:missing value, enabled:missing value, maximum value:missing value, role:AXGroup, entire contents:, subrole:missing value, selected:missing value, name:missing value, description:groupe,
class:splitter group, minimum value:missing value, orientation:missing value, position:-129, 107, role description:diviser groupe, accessibility description:missing value, focused:false, title:missing value, size:1057, 940, value:missing value, help:missing value, enabled:missing value, maximum value:missing value, role:AXSplitGroup, entire contents:, subrole:missing value, selected:missing value, name:missing value, description:diviser groupe*)
end tell
end tell
end tell
Yvan KOENIG running Yosemite 10.10.5 in French (VALLAURIS, France) mercredi 30 septembre 2015 11:11:14