Using a command to edit a UrlFetch into another command

Using !addcom !command1 -a=!editcom !command2 *, I can edit a command using another command. My issue here is if I replace * with my $(urlfetch url), !command2 will be edited to only the result of said UrlFetch. My goal is to edit !command2 into the actual UrlFetch, so it gets called each time !command2 is executed.

To visualize a bit better: !addcom !command1 -a=!editcom !command2 $(urlfetch url) will result in:

Command   | Message
!command1 | !editcom !command2 [urlfetch]
!command2 | result

What I actually want is:

Command   | Message
!command1 | !editcom !command2 $(urlfetch url)
!command2 | [urlfetch]

Is this possible? I imagine I somehow have to turn the UrlFetch into some sort of plain text, or escape it somehow?

We can have eval literally output urlfetch as so.

$(eval `$`+`(urlfetch URL)`)
1 Like

Thank you very much, this works.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.