Closed porg closed 1 year ago
LIST="$@"
LISTHALF=$(echo $LIST | cut -c -$(echo "scale=0; $(echo $LIST | wc -c) / 2" | bc))
RESULT=$($HOME/bin/bin/get_dropbox_link.py "$LISTHALF")
LOG="$HOME/Library/Logs/get_dropbox_link_debug.txt"
echo INPUT: >> "$LOG"
echo $LIST >> "$LOG"
echo >> "$LOG"
echo HALFED: >> "$LOG"
echo $LISTHALF >> "$LOG"
echo >> "$LOG"
echo RESULT: >> "$LOG"
echo $RESULT >> "$LOG"
echo >> "$LOG"
# echo "$RESULT"
Good news: Both the newest Readme.md
and also the newest included Automator file don't have that "Get Selected Finder Items" block anymore. Seems I had an outdated earlier version and had to learn it the hard way myself. 😉
Yep, I ran into the same issue and tweaked the code and README to fix it. Sorry you had to spend the time again, but hey: now you know a bit more about Automator, right? 😉
Yes, and I learned how to cut a string in half in the Shell, haha!
✅ Running the script in the shell returns as many URLs as files you provided
❌ But in Automator the list of selected files in Finder is twice in
$@
hence you also get the URLs twiceShell Script in Automator
The log:
Followup
$@
in half in the shell script environment and then pass on that cleaned file list toget_dropbox_link.py