Execute o arquivo unix com o applescript mostrando o resultado

0

Eu uso o seguinte script link
Funciona muito bem com o terminal.

Agora eu quero usá-lo com o applescript.
Eu penso sobre "fazer shell script" e que o script está no diretório "Recursos"

Eu tento esta solução, mas não funciona.

Meu alvo: quero um aplicativo de script de maçã que mostre o status da garantia.

Obrigado pela sua ajuda.

meu código de applescript

set warranty to do shell script "bash " & POSIX path of (path to me) & "Contents/Resources/warranty.sh"
display dialog warranty

o erro:

error "/Users/tz/Desktop/warranty: line 43: 
Apple warranty estimation script.

This script estimates whether a given serial number is under warranty.
Input can be one or more given serial numbers, or a text file listing serials.
Output can be standard out or a CSV file.

usage: warranty [-h] [-v] [--quit-on-error] [-i INPUT] [-o OUTPUT] ...

positional arguments:
  serials

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose         print output to console while writing to file
  --quit-on-error       if an error is encountered
  -i INPUT, --input INPUT
                        import serials from a file
  -o OUTPUT, --output OUTPUT
                        save output to a csv file

: command not found
/Users/tz/Desktop/warranty: line 45: import: command not found
/Users/tz/Desktop/warranty: line 46: import: command not found
/Users/tz/Desktop/warranty: line 47: import: command not found
/Users/tz/Desktop/warranty: line 48: import: command not found
from: can't read /var/mail/dateutil
/Users/tz/Desktop/warranty: line 50: import: command not found
/Users/tz/Desktop/warranty: line 51: import: command not found
/Users/tz/Desktop/warranty: line 52: import: command not found
/Users/tz/Desktop/warranty: line 53: import: command not found
/Users/tz/Desktop/warranty: line 54: import: command not found
/Users/tz/Desktop/warranty: line 56: syntax error near unexpected token '('
/Users/tz/Desktop/warranty: line 56: 'def get_asd_plist():'" number 2
    
por Zesa 04.08.2016 / 11:39

0 respostas