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

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -