Heya Brady, please use code tags for code, output, or any other kind structured text.
But figure yourself:
check_path="/volumes/audioNAS/Firstcom/Access Music"
if [ -r "$check_path" ]
then for item in "$check_path"/*
do case "${item##*/}" in
AM017Q) echo yay ; break ;;
esac
done
fi
Compared to:
check_path="/volumes/audioNAS/Firstcom/Access Music"
if [ -r "$check_path" ]
then for item in "$check_path"/*
do case "${item##*/}" in
AM017Q) echo yay ; break ;;
esac
done
else echo "Cant read: $check_path!"
fi
For the future, thank you.
Hope this helps
EDIT:
Explanation:
This will look all files/folders (item) of check_path - if it can read from there at all, and if an entry is found named AM017Q it will print yay and break the loop.
I am not a coder, I am and audio post engineer who is writing code to find a file for me so I don't have to click 50 times to find what i am looking or.
I am using Applescript so usually I have to add "do shell script" before the code in my Applescript. Can you confirm.
thanks
---------- Post updated at 11:08 AM ---------- Previous update was at 11:05 AM ----------
if CD_numb starts with "AM" then
tell application "Finder"
try
set the_Firstcom_CD to (do shell script "ls -d '/volumes/audioNAS/Firstcom/Access Music/ & CD_numb & " * "'")
open POSIX file the_Firstcom_CD as alias
set bounds of Finder window 1 to {100, 90, 875, 990}
end try
end tell
end if
But anyway, the * is working as expected, since you pass the full path to it, it is included in the output string.
If you want only the names of the items within that folder, you'll have to change there, and then use only the asterix * .
At least in theory, as i dont know hot to perform string-subtraction within such an environment.
hth
---------- Post updated at 17:17 ---------- Previous update was at 17:14 ----------
Rather than learning a (somehow) limited language, why not use the reall shell?
Just copy paste the code of mine into a new textfile, open a terminal, change to where you stored that file and type:
bash ./script-name.sh
Where script-name.sh is obviously the name you stored it as.
You could then (if it worked as expeceted) try to execute that script from within your applescript, maybe that could work?