View Single Post
  #273  
Old 06-27-2020, 09:36 AM
oudi oudi is offline
Member
 
Join Date: Jun 2007
Posts: 14
Default Re: Automation AppleScripts for Pro Tools (Mac)

hi

i've found a solution for close any open audio suite


Code:
tell application "System Events"
    tell application process "Pro Tools"
        set frontmost to true
        try
            set plug to first window whose title contains "Audio Suite:"
        on error
            display alert " No Audio suite open"
            return
        end try
        set f to get subrole of button of plug
    end tell
end tell

set closeBtnPos to getPositionOfItemInList("AXCloseButton", f)
tell application "System Events"
    click button closeBtnPos of plug
end tell


on getPositionOfItemInList(theItem, theList)
    repeat with a from 1 to count of theList
        if item a of theList is theItem then return a
    end repeat
    return 0
end getPositionOfItemInList
so happy
enjoy

Last edited by oudi; 06-27-2020 at 09:58 AM.
Reply With Quote