Workflow reminds me of AppleScript

Workflow is an automation tool for iOS. The app is great, so great in fact that Apple bought the company.

However, when trying to do something simple like prepend asterisks to a list of text on the clipboard, I immediately ran into confusion and had to find another workflow someone else wrote to get over the hump.

AppleScript was this way – Promise of grandeur, then a lot of skinned knees.

In the end, I got the task working, but it was not at all obvious, especially since my text, a table from Numbers, isn’t exactly text.

The solution?

  • Get Clipboard
  • Repeat over every item on the clipboard
    • Split the text on new lines
    • Replace ^ with “* ” using a regular expression

  • Combine the text with a new line
  • Send to Clipboard
The real problem here is that iOS doesn’t let you introspect the type of data that is on the Clipboard, nor does workflow let you introspect what is in a variable. You kinda have to just look at the output and guess. Why did some operations result in 183 pages of text? I still don’t know.