Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com)
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi
Tinderbox Users >> Agent, Actions, Rules & Automation >> Help with RunCommand quoting
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi?num=1450039203

Message started by Derek Van Ittersum on Dec 13th, 2015, 3:40pm

Title: Help with RunCommand quoting
Post by Derek Van Ittersum on Dec 13th, 2015, 3:40pm

So I currently have the following stamp which works. I had tried to get the code into a "code note", but couldn't figure out the nested quotations.

$TitleEnc=urlEncode($Name);$NoteEnc=urlEncode($Text);$DoUrl="twodo://x-callback-url/add?task="+$TitleEnc+"&note="+$NoteEnc+"&tags="+$DoTags+"&due="+$DueDate.format("y-M0-D")+"&dueTime="+$DueDate.format("h:mm")+"&start="+$StartDate.format("y-M0-D%20h:mm");$DoUrl2="open '"+$DoUrl+"'";runCommand($DoUrl2)

So basically, I'm URL encoding a few attributes, which I understand. Then I'm, creating the "URL" string out of a few attributes, then storing in the "DoURL" string. Then I need to wrap that string in a quotation before passing to run command, so I do that in by storing it in the "DoURL2" string. It's these last two steps that I think must be unnecessary and can be stored in a Code Note of some sort, right?

here's the basic form of the url that I need to pass to command line:


Code:
open "twodo://x-callback-url/add?task=Testing&note=theNote"


Let me know if I've left out some important variables / details. As I said, it's working as is, I'm just hoping to learn a bit more about using code notes for this sort of process.

Title: Re: Help with RunCommand quoting
Post by Mark Anderson on Dec 13th, 2015, 4:23pm

I think the last two may be run as $DoUrl2 = runcommand('open ', $DoUrl) as per syntax here. But if it works for now, I'd be tempted to leave it alone. The need for 'code notes' arises where there are completx quoting issues - essentially you can run out of different types of quotes to nest.

Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com) » Powered by YaBB 2.2.1!
YaBB © 2000-2008. All Rights Reserved.