小编Sve*_*don的帖子

如何使 Platypus 创建的 shell 应用程序响应键盘命令?

我使用 Platypus 创建了一个简单的应用程序,它运行以下 shell 脚本:

    cd
    if [ -e /Applications/Music.app/Contents/Resources/Music.py ]; then
      export PATH=$PATH:/Applications/Music.app/Contents/Resources
      cd "/Applications/Music.app/Contents/Resources"
      EXTENSION=`osascript -e 'tell application (path to frontmost application as text) to display dialog "Do you want to enable extensions during this session?" buttons {"Yes", "No"} with  icon file "Applications:Music.app:Contents:Resources:alert.icns"'`
      if [ "$EXTENSION" == "button returned:Yes" ]; then
        python Music.py arg1 >> music.txt &
      else
        python Music.py arg2 >> music.txt &
      fi
    else
      osascript -e 'tell application (path to frontmost application as text) to display …
Run Code Online (Sandbox Code Playgroud)

python shell platypus

5
推荐指数
0
解决办法
440
查看次数

标签 统计

platypus ×1

python ×1

shell ×1