content: property pTitle : "Tag all folded nodes"
  property pVer : "0.01"
  property pAuthor : "Robin Trew"
  
  property pstrTag : "fold"
  
  on run
  	tell application "FoldingText"
  		set lstDocs to documents
  		if lstDocs ≠ {} then
  			tell item 1 of lstDocs
  				set {dlm, my text item delimiters} to {my text item delimiters, ","}
  				set strFoldNodes to (read JSON (body of (read JSON (HTTP request URI "/view/collapsed.json")))) as string
  				set my text item delimiters to dlm
  				
  				HTTP request method "PATCH" URI "/nodes/" & strFoldNodes & ".json" body "{\"addTags\":{\"" & pstrTag & "\":\"\"}}"
  			end tell
  		end if
  	end tell
  end run
  