Pass variable from applescript to executable bash file -
is possible pass variable applescript executable bash file? if so, how write executable bash file accept parameters? i'm going passing in dynamic filename appended file path in executable file.
applescript...
global set "test123.pdf" shell script "/users/matt/firstscript " &
bash file...
#!/bin/bash b64test=$( base64 /users/matt/documents/$1) echo $b64test | pbcopy echo $b64test > users/matt/base64
your applescript need like:
global set "test123.pdf" shell script "/users/matt/firstscript " &
then in script can refer parameters $1
, $2
, etc, or $@
of them.
#!/bin/bash b64_test=$( base64 /users/matt/documents/$1) echo $b64_test | pbcopy echo $b64_test > /users/matt/base64
note not idea name bash variable test
, name of shell builtin command. kinds of confusion can ensue.
alternatively, should able without shell script:
set quoted form of "/users/matt/documents/test123.pdf" shell script "base64 " & & " | pbcopy"
Comments
Post a Comment