3

I have a script which perform the following:

  1. Load a file into a program (Subler — done separately, not in this script)
  2. Confirm the loading of the file (this is where the script begins)
  3. Saves the file
  4. In the save location window it selects a specific directory to save the file in
  5. Presses "return"

I would like to know how to perform step 4 with the active (or last used) window instead of a specific window title.

This is the relevant code:

get every action of list 1 of scroll area 1 of scroll area 1 of browser 1 of splitter group 1 of group 2 of sheet 1 of window "untitled"

This is the entire code:

on run 

    tell application "Subler" to activate
    delay 1

    tell application "System Events"
        delay 0.5
        keystroke return
        delay 1
        keystroke "s" using command down
    end tell

    activate application "Subler"
    tell application "System Events"
        tell process "Subler"
            get every action of list 1 of scroll area 1 of scroll area 1 of browser 1 of splitter group 1 of group 2 of sheet 1 of window "untitled"
        end tell

    end tell

    tell application "Subler" to activate
    delay 1

    tell application "System Events"
    end tell

    return input
end run
5

It's been a while since I played with Applescript, but I think it's just 'window 1' [without quotes] for the frontmost window.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .