how to pass command-line arguments to a program run with the open command?

前端 未结 3 1095
日久生厌
日久生厌 2020-12-05 10:23

Is there a way to pass arguments to a program being run via:

open -a /Applications/Utilities/Terminal.app ~/my_executable

I have tried:

3条回答
  •  误落风尘
    2020-12-05 11:17

    Yes, I know. need to manage another script. but think differently. you work not on Terminal, but on Script Editor. (not bash scripting, but AppleScript'ing)

    property testScript : "/tmp/sh.sh"
    
    set input to display dialog "args?" default answer ""
    log input
    tell application "Terminal"
        activate
        do script testScript & " " & text returned of input
    end tell
    

提交回复
热议问题