How to Select a Pulldown for File Type within a Save As Menu WITHOUT mouse movements

This part of the script was working before — wasn’t it?

-ccs

At this time - the old version has the same issue.

Hey Thomas,

Run this from the Script Editor with the export dialog open in MoneyMoney:

----------------------------------------------------------------

set AppleScript's text item delimiters to linefeed

tell application "System Events"
   tell application process "MoneyMoney"
      set its frontmost to true
      tell window "MoneyMoney"
         tell sheet 1
            if (it exists) = false then error "The save dialog is NOT open!"
            
            --» Set file-type to save.
            tell group 1
               tell pop up button 1
                  perform action "AXShowMenu"
                  delay 0.9
                  tell menu 1
                     
                     return (name of menu items) as text
                     
                  end tell
               end tell
            end tell
            
         end tell
      end tell
   end tell
end tell

----------------------------------------------------------------

You’ll get a list of the names of the available file formats.

Make sure the name you’re using exactly corresponds to the one in the list.

-Chris

@ccstone: The Popup menu opens and then I got an error:

„System Events“ received an error: „menu 1 of pop up button 1 of group 1 of sheet 1 of window "MoneyMoney" of application process "MoneyMoney"“ can not read. Invalid index.

Script Debugger message:
get name of every menu item of menu 1 of pop up button 1 of group 1 of sheet 1 of window "MoneyMoney" of application process "MoneyMoney" Index is out of range. (errAEIllegalIndex:-1749)

Video (click)

Hey Thomas,

Grrff…

Which export command are you using in MoneyMoney?

-Chris

Konto -> Umsätze exportieren

This is the path to the ui element:

Hey Thomas,

I have the MoneyMoney version 2.3.3 demo — what version do you have?

I’m using macOS 10.12.6 — what version are you using?

The works perfectly on my system to toggle between the two file types:

----------------------------------------------------------------
tell application "System Events"
   tell application process "MoneyMoney"
      tell window "MoneyMoney"
         tell sheet 1
            tell group 1
               tell pop up button 1
                  
                  set popupButtonName to its value
                  
                  click
                  
                  repeat while (exists of menu 1) is false
                     delay 0.25
                  end repeat
                  
                  tell menu 1
                     if popupButtonName = "CSV file (.csv)" then
                        click menu item "OFX file (.ofx)"
                     else
                        click menu item "CSV file (.csv)"
                     end if
                  end tell
                  
               end tell
            end tell
         end tell
      end tell
   end tell
end tell
----------------------------------------------------------------

I’m using Account > Export Transactions, since I don’t have an Export Sales item.

You might try the above script on that same item just for giggles.

Otherwise I don’t really see why there’s a problem. The UI structure looks the same on your system as it does on mine.

You might be able to get more expert help on the UI Browser List.

https://groups.yahoo.com/neo/groups/uibrowser/info

The dev hangs out there.

-Chris

Hi Chris,

I take the UI browser shots only for you - for troubleshooting.
My Version: 2.3.3 on 10.11.6.

Yeah! The latest Code is works for me.

1 Like

Hey Thomas,

Well good deal!

I'll let you take it from there.

-Chris