Qt with Applescript on OSX 10.9

  • The following codes work well on OSX 10.8,but work partly well on OSX 10.9("click button -3\nclick radio button -2 of tab group 1 of sheet 1" failed.), how to fix it?
    the applescript itself is ok, because it works with applescript editor utility on OSX 10.9.

    @ QString aScript = "tell application "System Preferences"\nset current pane to pane "com.apple.preference.network"\nactivate\ntell application "System Events" to tell process "System Preferences" to tell window 1\nclick button -3\nclick radio button -2 of tab group 1 of sheet 1\nend tell\nend tell";

    QString osascript = "/usr/bin/osascript";
    QStringList processArguments;
    processArguments << "-l" << "AppleScript";
    QProcess p;
    p.start(osascript, processArguments);

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.