content: -- Change first selected node to heading, 
  -- or reduce its header level if already a heading
  
  -- Useful, in conjunction with MarkOrIncreaseHeading, for quickly adjusting the level of a hash header
  
  -- DEV 1.1 Script
  
  property pstrType : "heading"
  property pstrAltType : "unordered"
  
  on run
  	tell application "FoldingText"
  		-- CHECK THAT THERE IS A DOCUMENT
  		set lstDocs to documents
  		if lstDocs ≠ {} then
  			
  			-- READ THE ID TYPE AND LEVEL OF THE SELECTION
  			tell item 1 of lstDocs
  				set recSeln to (read selection)
  				if recSeln is missing value then return
  				set lngPosn to location of textRange of recSeln
  				
  				set {strID, strType, lngLevel} to {|id|, |type|, level} of item 1 of ¬
  					(read nodes at path nodePath of (recSeln))
  				
  				-- DECIDE WHETHER TO DO NOTHING OR DEEPEN THE EXISTING LEVEL
  				if strType ≠ pstrType then
  					set recChanges to {}
  				else
  					if lngLevel = 0 then
  						-- Only one hash left - convert to unordered list
  						set recChanges to {|type|:pstrAltType}
  					else
  						set recChanges to {level:lngLevel - 1}
  						set lngPosn to lngPosn - 1
  					end if
  				end if
  				
  				-- AND MAKE ANY CHANGE
  				recChanges
  				if recChanges ≠ {} then
  					update nodes at ids {strID} with changes recChanges
  					
  					set location of textRange of recSeln to lngPosn
  					update selection with changes recSeln
  				end if
  			end tell
  		end if
  	end tell
  end run
  