4 ms·
Wow, this is awesome! Is there any way to make it work without selecting text? (default to all available text on the textarea) BTW, I changed a few things: em
by d1egoaz 9y ago
Wow, this is awesome!
Is there any way to make it work without selecting text? (default to all available text on the textarea)
BTW, I changed a few things:
emacsclient path and the tmp folder:
tmp=$(mktemp "/tmp/EditTextinEmacsXXXXXXXX")
ec=/usr/local/bin/emacsclient
cat > "$tmp"
until [ $($ec -q -e '(server-running-p)' 2>/dev/null) == t ]; do
sleep 1
done
$ec -q -c "$tmp"
rv="$?"
cat "$tmp"
if [ $rv -ne 0 ]; then
echo "Something went wrong. Please find your text in"
echo "$tmp"
else
rm "$tmp"
fi
- swsieber 9y agoHmm... I'm not very familiar with this, but couldn't you send a key command to select the entire text (CMD A)?
- d1egoaz 9y agoI'm not very familiar either. But the Automator workflow starts with "receives selected text", so I'm not sure it has access to the current text field
- swsieber 9y agoDid not know that. I've used HammerSpoon on Mac, and you can send key shortcuts with that... you could probably glue them together easily
- d1egoaz 9y agoosascript is our friend osascript -e 'tell application "System Events" to keystroke "a" using command down'
- d1egoaz 9y agoI ended forking and creating this https://github.com/d1egoaz/vim-anywhere https://github.com/d1egoaz/vim-anywhere WIP