Pass a variable from bash shell into Applescript? Using the path defined in bash shell How would i pass the variable to applescript using osascript/applescript? Here's what I have so far.. The path of $FOOD_NUM is subject to change and it must be a variable that I have defined in bash. The "-e open... doesn't seem to like the path. error code 810:815: execution error: The variable input is not defined. (-2753  Thanks!.     

FOOD_file=~/Desktop/FOOD/FRUIT/
FOOD_NUM=012345 
osascript -e 'tell application "Adobe Photoshop CC 2017"'
-e 'open "'$FOOD_file/$FOOD_NUM/apples.psd'"' -e 'end tell'
Instead of using Applescript to open Photoshop, why not just open it directly with the open command in bash?

FOOD_file=~/Desktop/FOOD/FRUIT/
FOOD_NUM=012345 
open -a "Adobe Photoshop CC 2017" $FOOD_file/$FOOD_NUM/apples.psd


Now you don't need to worry about using Applescript at all.