Tuesday, 22 January 2013

looking for simple clipboard monitoring solution


hi,

have been trying find os x tool 1 specific task , couldn't find it. need have program running in background , monitoring clipboard. when contents of clipboard matches regexp should execute script contents of clipboard being passed on parameter.

there's tons of clipboard managers both free , not, none seems have exact type of functionality. can suggest tool or possible solution doesn't involve system programming? maybe achievable higher level tools shell scripts, launchd, applescript or automator?

thank you.
 

it's funny how right when saying - 1 has know half of answer ask right question. posting message , mentioning shell scripts got me thinking, , 10 minutes later shell script solution problem has been created. here is:

#!/bin/bash

while :
do
clipboard=`pbpaste`
if [[ "$clipboard" =~ <mypattern> ]]
then
<myscript.sh> $clipboard
pbcopy < /dev/null
fi
sleep 1
done

crude task , doesn't eat resources.

if knows of cleaner way accomplish or existing software solution please let me know.
 


Forums Macs macOS Older OS X Versions Mac OS X Lion (10.7)


  • iPhone
  • Mac OS & System Software
  • iPad
  • Apple Watch
  • Notebooks
  • iTunes
  • Apple ID
  • iCloud
  • Desktop Computers
  • Apple Music
  • Professional Applications
  • iPod
  • iWork
  • Apple TV
  • iLife
  • Wireless

No comments:

Post a Comment