One issue with apps like this is getting docs in there in the first place. Many apps, Editorial included, can access a Dropbox account, and will by default set up their own directory in /Apps/. So one has a choice of manually moving documents to and from that directory, or making one’s entire working directory available to the app. This latter is overkill, so I was looking for an easy way to get stuff into and out of Editorial. The solution is to stick the following bash code into an automator service. When run on a file, it will move that file into the Editorial Dropbox directory, and create a placeholder file with extension “edi” in it’s place. Running the script on the “.edi” file will move the document back to its home (and delete the edi placeholder).
xpath=${1%/*}
xbase=${1##*/}
xfext=${xbase##*.}
xpref=${xbase%.*}
editorialDir="/Your/Editorial/Dropbox/Directory"
if [ "$xfext" == "edi" ]
then
echo "here!"
targName=`less $1`
mv $editorialDir/$targName $xpath
rm $1
else
if [ -a $editorialDir/$xbase ]
then
COUNTER=2
while [ -a $editorialDir/$xpref$COUNTER.$xfext ]; do
let COUNTER=COUNTER+1
done
targName=$xbase$COUNTER.$xfext
fi
mv $1 $editorialDir/$targName
echo "$xpref$COUNTER.$xfext" > $xpath/$xpref.edi
fi