I'd like to capture everything I type into Spotlight and use the text as input for a script, possibly a new instance of a Services workflow.

From that point of course anything is possible; the most trivial case for the workflow script is to simply log its input:

echo "$*" >> /home/myFolder/myLog


  • If there is in fact a system log for Spotlight's queries, this would be interesting information and would not answer my question [completely].
  • I am aware that the Service may have to be spawned for each keystroke, since Spotlight shows new results as you type.
  • You can try a basic key logger which also notes the app your typing the command in. Than run a script to extract what you need. – CousinCocaine Jul 4 '14 at 17:27
  • Send an email to the NSA, I bet they know what you typed in your spotlight search bar. – CousinCocaine Jul 4 '14 at 17:27
  • @CousinCocaine I'm sure they do! They, however, will not help me trigger actions in real time based on my input. Regarding key logger, do you suppose such a program would be a more reliable way to get results? – ProductionValues Jul 4 '14 at 17:36
  • never tried a key logger. listening to Service might indeed be a better idea. No clue how ;) – CousinCocaine Jul 4 '14 at 17:44

You must log in to answer this question.

Browse other questions tagged .