i have a small Problem with a osascrip line in a bash script. The bash script gets called via a Applescript 'choose from list' dialogue, and then you can define options via a if [[ $* = *"Option 1... selection tag.
A friend gave me the osascript line, the 'choose a file' dialogue shows up and it works for choosing things, however the 'cancel' button also triggers the 'Choose a file' dialogue.
I feel the osascript line is somewhere incomplete near the end because both OK and cancel trigger the choose a file dialogue.
looks like this in a bash script:
#!/bin/bash
WORKDIR="$(dirname "$0")/"
STARTUPFILE="$(/usr/bin/osascript -e "tell application \"System Events\" to activate" -e "tell application \"System Events\" to set thefile to choose file with prompt \"Choose something here\"" -e "do shell script (\"echo \"&(quoted form of POSIX path of thefile as Unicode text)&\"\")")"
if [[ $* = *"Option 1 from Applescript"* ]]; then
cp -R "$STARTUPFILE/" "somewhere else"
do other stuff with "$STARTUPFILE...
Any idea where the cancel option is missing in the osascript line and how i could implement it?