oops!
(*
============================================================================
// From: https://discourse.devontechnologies.com/t/apple-script-to-add-tagged-items-to-todoist/55582/28
//
// Comment: https://discourse.devontechnologies.com/t/apple-script-to-add-tagged-items-to-todoist/55582/29
============================================================================
*)
on performSmartRule(theRecords)
repeat with theRecord in theRecords
tell application id "DNtp"
set this_subject to (name of theRecord) as Unicode text
set the_reference to (the reference URL of theRecord) as string
end tell
set the_new_reference to findAndReplaceinText(the_reference, "$", "\\$")
do shell script "/Users/robertallred/Scripts/addSubjectWithLink.sh " & "\"" & this_subject & "\" \"" & the_new_reference & "\""
end repeat
end performSmartRule
on findAndReplaceinText(theText, theSearchString, theReplacementString)
set AppleScript's text item delimiters to theSearchString
set theTextItems to every text item of theText
set AppleScript's text item delimiters to theReplacementString
set theText to theTextItems as string
set AppleScript's text item delimiters to ""
return theText
end findAndReplaceinText
EDIT: You do need the Todoist CLI installed as well.