OSX Automator - open app in application contents folder?

This following AppleScript code will launch Outlook Profile Manager.app then lets you choose the desired profile from a list, selects your chosen list item, quits Outlook Profile Manager.app , and activates Outlook.app

You can add a Run AppleScript command to your Automator workflow and insert this following AppleScript, or run it in Script Editor.app.

Tested using macOS Big Sur.

tell application id "com.microsoft.outlook.profilemanager" to activate

tell application "System Events"
    tell its application process "Outlook Profile Manager"
        set frontmost to true
        repeat until exists of group 1 of window 1
            delay 0.1
        end repeat
        set theProfiles to get value of text field 1 of rows of ¬
            table 1 of scroll area 1 of group 1 of window 1
        tell current application
            activate
            set chosenProfile to (choose from list theProfiles with title ¬
                "Choose Profile" with prompt "Choose Profile" OK button name ¬
                "OK" cancel button name "Cancel") as text
            if chosenProfile = "false" then
                tell application id "com.microsoft.outlook.profilemanager" to quit
                return
            end if
            set theCount to 1
            repeat with i from 1 to count of theProfiles
                set thisItem to item i of theProfiles
                if thisItem = chosenProfile then
                    exit repeat
                else
                    set theCount to theCount + 1
                end if
            end repeat
        end tell
        set frontmost to true
        repeat until exists of group 1 of window 1
            delay 0.1
        end repeat
        set selected of row theCount of table 1 of scroll area 1 ¬
            of group 1 of window 1 to true
        click menu button 1 of group 1 of window 1
        click menu item "Set as Default" of menu 1 of ¬
            menu button 1 of group 1 of window 1
    end tell
end tell

tell application id "com.microsoft.outlook.profilemanager" to quit
repeat while application id "com.microsoft.outlook.profilemanager" is running
    delay 0.1
end repeat
tell application id "com.microsoft.Outlook" to activate