EDIT: I'm trying to save a session file from the Web Proxy Debugging App Charles (http://www.charlesproxy.com/) using AppleScript. Basically, I select "Export", put in a temp name, and then save it. However, after I click on combo box 2, which is the "Format" area, and then try to click on pop up button "XML Session File (.xml)", the Applescript Editor throws an error saying it can't find it.
At the moment I hacked it with the following code, but for some reason it only works on the Applescript Editor and sometimes in Terminal/my code, especially when I am doing other actions at the same time.
tell application "Charles"
activate
end tell
tell application "System Events"
tell process "Charles"
tell menu bar 1
click menu bar item "File"
tell menu "File"
click menu item "Export..."
end tell
end tell
tell window "Save"
keystroke "tempCharles"
delay 0.5
click combo box 2
delay 0.5
key code 125 -- down arrow
delay 0.2
key code 125
delay 0.2
key code 125
delay 0.2
key code 125
delay 0.2
keystroke return
delay 0.4
keystroke return
delay 0.4
keystroke return
end tell
end tell
end tell
I want my code to look something like this
tell window "Save"
keystroke "tempCharles.xml"
delay 3
click combo box 2
tell combo box 2
click pop up button "XML Session File (.xml)"
end tell
click button "Save"
end tell
Any hack is fine too. Before posting, trying running "osascript" on Terminal to check if it works not through AppleScript Editor.