Do you know Alfred? It is a Mac OS app to replace Spotlight and enhance the functionality which Cmd + Space offers you.
I implemented/copied a couple of simple scripts in the past, one of it was a JIRA Script by Sal Ferrarello which helped me open JIRA tickets with the keyboard.
Today I got a list of tickets by my PM and I thought it should be possible to open more than one ticket, so I wanted to change the workflow, but I couldn’t find any kind of “loop” and before searching for a solution (that should be possible, shouldn’t it? I learned, that I could use PHP ? <3
PHP in Alfred
Find the option “Run script”, then you see this window. In the upper left you choose “php” and that’s it! You can use Ruby, Perl, Python or Bash if you prefer 🙂

<?php $query = '{query}'; $tickets = array_map('trim', explode(' ', str_replace("\n", ' ', trim($query)))); foreach ($tickets as $ticket) { $url = "https://winkelwagen.atlassian.net/browse/$ticket"; exec("open $url"); }
Overall the workflow is simple:
