content: -- TOGGLE SELECTED LINES BETWEEN SINGLE AND DOUBLE SPACING
  -- (EITHER NO BLANK LINES OR ONE BLANK LINE AFTER EVERY TEXT LINE)
  
  property pstrNoText : "((//@type=empty) union (//@line matches '^\\s*$'))"
  
  on run
  	tell application "FoldingText"
  		set lstDocs to documents
  		if lstDocs ≠ {} then
  			tell item 1 of lstDocs
  				-- GET THE PATH OF ANY CURRENT SELECTION
  				set recSeln to (read selection)
  				if recSeln is missing value then return
  				set strSelnPath to (nodePath of recSeln)
  				
  				-- COUNT THE BLANKS IN THE SELECTION
  				set strBlanksPath to (strSelnPath & " intersect " & pstrNoText)
  				set lstBlanks to read nodes at path strBlanksPath
  				if lstBlanks ≠ {} then
  					-- IF THERE ARE ANY BLANKS IN THE SELCTION, REMOVE THEM ...
  					delete nodes at path strBlanksPath
  				else
  					-- IF THERE ARE NONE, SEPARATE OUT THE LINES IN THE SELECTION
  					-- (ADD A SINGLE BLANK AFTER EVERY TEXT NODE IN THE SELECTION)
  					repeat with oLine in (read nodes at path strSelnPath)
  						create nodes at id (|id| of oLine) with relation "nextLine" from text ""
  					end repeat
  				end if
  			end tell
  		end if
  	end tell
  end run
  
  
  