URL doesn't work with Tasks

Hi there,

I’ve been really enjoying using OmniAutomation to create new workflows. However, I’ve recently run into an issue that I would like some help on.

I’m trying to use an URL scheme to export some variables in my OF database, but it seems to be not working.

According to the documentation on URL, this is possible and it works:

textToPass = encodeURIComponent("How Now Brown Cow")
URL.fromString('x-bbedit://new-document/?text=' + textToPass).open()

However, this returns a null value:

document.windows[0].selection.tasks.forEach(function(task){
   URL.fromString('x-bbedit://new-document/?text=' + task.name)
})

The error associated with it is:

TypeError: null is not an object (evaluating 'URL.fromString('x-bbedit://new-document/?text=' + task.name).open') undefined:1:61

I’m very confused why this error is occurring. I’ve checked that the type of task.name is a string by using the typeof function, so shouldn’t it work like the example above?

Thanks in advance.

I think you should URL-encode it.