QT & AppleScript



  • The OS X version of my QT program needs to open Terminal.app with multiple arguments. Since Terminal.app doesn't take arguments, My best guess is to use AppleScript to simulate that. What I'm looking for is for Terminal to open an adb shell session against a specific device. Doing it manually from a console you'd see something like this:

    $ adb -s mydevice:5555 shell (This opens up a ssh like connection to an android device.)

    How can I pass this to Terminal.app using Applescript? I can open Terminal.app with startDetached running an AppleScript with hardcoded values:

    @
    tell application "Terminal"
    activate
    set shell to do script "/Applications/myapp/adb shell" in window 1
    end tell
    @

    But I've no success passing multiple arguments. Someone suggested using a bash script, but calling a bash script with startDetached does not open up a console for interaction. Is there another way for QT to accomplish what I need? This operation is easy-peasy using QT/Windows, since cmd accepts arguments.


  • Lifetime Qt Champion

    Hi,

    Maybe "this":http://stackoverflow.com/a/3657363 will help



  • Thanks. Still no joy.



  • open a '.command' file instead of a bash script ?



  • I tried that :(

    http://qt-project.org/forums/viewthread/44540/

    It's frustrating that something so trivial is such a time sink. In Windows it's dead-easy:

    @
    if (os == 1)
    {
    cstring = "cmd /k adb -s "+ daddr+port+" shell";
    QProcess::startDetached(cstring);
    }
    @


Log in to reply
 

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