1

Seems to be a very simple question, but i cannot find the answer in the many many documentation that is around on Applescript.

I have a non-scriptable application for which i want to open a file using the File Open dialog in the application. This is what i came up with so far:

tell application "CubicSDR"
    activate
end tell

tell application "System Events" to tell process "CubicSDR"
    set position of window 2 to {-1920, -296}
    set size of window 2 to {1635, 500}
    click menu item "Open Session" of menu "File" of menu bar 1
    ......
end tell

Then i have tried to select a file, open a file, click a file, nothing seems to work. This can not be as hard as it seems considering that this is such a common operation. Does anybody have a code sample i can work off?

1

Here you go:

tell application "Mail" to open "Library:Desktop Pictures:Small Ripples graphite.png"

Replace "Mail" and the file with the app and file you want to open your file with, respectively.

  • The application that needs to open the file apparently is not AppleScript enabled. So i have to do it through the System Events. – Ton Machielsen Nov 20 '16 at 11:44
  • @TonMachielsen thank you for letting me know that this way did not work with our specific application. What is the language your OS is set to? – oa- Nov 20 '16 at 17:45
  • OSX is set to English (US). – Ton Machielsen Dec 4 '16 at 10:56

You must log in to answer this question.

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