Run Script with Alfred Remote
With Alfred Remote, you can run scripts to perform actions directly from your Remote, in the same way as you can from your Mac using Alfred's Workflows.
Add a "Run Script" object, and select your preffered interpreter from the dropdown menu. Paste in your script below.
You can replace the icon for it by dragging a new one on the default icon, and you can change the title below it.
For more advanced actions, take a look at Workflow Triggers.