Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt with Applescript on OSX 10.9
Qt 6.11 is out! See what's new in the release blog

Qt with Applescript on OSX 10.9

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 778 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gaojinhsu
    wrote on last edited by
    #1

    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);
    p.write(aScript.toUtf8());
    p.closeWriteChannel();
    p.waitForFinished();@
    
    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved