View Single Post
  #274  
Old 06-29-2020, 04:35 AM
Oliver M Oliver M is offline
Member
 
Join Date: Dec 1969
Location: Europe
Posts: 1,108
Default Re: Automation AppleScripts for Pro Tools (Mac)

Quote:
Originally Posted by oudi View Post
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
👍
Reply With Quote