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 & AppleScript
Forum Updated to NodeBB v4.3 + New Features

QT & AppleScript

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 1.3k 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.
  • J Offline
    J Offline
    jocala
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

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

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jocala
        wrote on last edited by
        #3

        Thanks. Still no joy.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          sandy.martel
          wrote on last edited by
          #4

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

          1 Reply Last reply
          0
          • J Offline
            J Offline
            jocala
            wrote on last edited by
            #5

            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);
            }
            @

            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