proc Wedge() integer min1, max1, cpos, buildpos, stem, lineno=2, oneline=0 string spos[8], buildline[60] EndFile() if (CurrLine() == 1) oneline = 1 InsertLine("!NoteWorthyComposerClip(2.0,Single)") endif BegFile() loop BegLine() if lfind("Clip-End","c") break endif if lfind("{\|Note\|}|{\|Chord\|}","x") else break endif lineno = CurrLine() if lfind("Stem=Up","c") // See if stem direction is provided stem = -1 else if lfind("Stem=Down","c") stem = 1 else stem = 0 // Will have to determine stem direction endif endif GoToColumn(2) if (lFind("Note","c")) lfind("Pos:","c") //Find where the note is. lfind("-*[0-9]#","+xc") //Next char, reg expression, current line spos=GetFoundText() //Look for - sign & max number of digits min1= Val(spos) // Convert from string to integer max1= min1 // Only one note so they are same. else //Must be a chord lfind("Pos:","c") //Find where the note is. lfind("-*[0-9]#","+xc") //Next char, reg expression, current line spos=GetFoundText() //Look for - sign & max number of digits min1= Val(spos) // Convert from string to integer EndLine() // go to end of line and backup lfind("-*[0-9]#","bxc") //Backwards char, reg expression, current line spos=GetFoundText() //Look for - sign & max number of digits max1= Val(spos) endif if (stem == 0) buildpos = min1 + max1 if (buildpos < 0) stem = -1 else stem = 1 endif endif if (stem == -1) //Stem was up cpos = min1 else if (stem == 1) //Stem was down cpos = max1 endif endif if(stem == -1) buildpos = cpos - 2 else buildpos = cpos + 4 endif if (stem == -1) buildline = Format('|Text|Text:"“"|Font:User2|Pos:',buildpos, "|Placement:AtNextNote") else buildline = Format('|Text|Text:"¢"|Font:User2|Pos:',buildpos, "|Placement:AtNextNote") endif InsertLine(buildline) if GoToLine(lineno + 2) else break endif if (oneline == 1) EndFile() AddLine("!NoteWorthyComposerClip-End") break endif endloop end proc Main() if isWinClipAvailable() //Is something on the clipboard PasteFromWinClip() //Copy from system clipboard Wedge() BegFile() //Prep to mark all editspace MarkLine() //Mark from front end EndFile() //Go to last line MarkLine() //Entire editspace is marked CopyToWinClip() // and will be written back to clipboard AbandonEditor() //Shutdown w/o prompt to save. else Warn("Nothing on the clipboard") //Nothing to do endif end