If break does not occur, then the else happens and the item key is added to the list. Then tries artist = … until all items are tried. # So 1st one it trys to match is start with name =. # The -1 will be replaced with numbers to order the lines later for sorting. 'loading_phrase', 'charter', 'frets', 'song_length'] # Here is PythonScript to replace the text in the current editor pane. The Notepad Python Script : # coding: utf8 I share with you the two scripts in final version. That’s a lot more than I expected.īIG THANKS to and other for contributions. I might even consider changing more elements very easily (thanks to list ‘presets’), and, amazing, modify the 5000 files without open them in Notepad (a lot of time saving). I have implemented both Notepad Python Script and Standalone recursive Python Script : both work perfectly. I have understood it thanks to his explanations. Otherwise, I’m extremely grateful to who gave me the solution “clé en main” (ready to use). ssageBox(targetString ' not found')ĮndLine = editor.getLineEndPosition(editor.lineFromPosition(endW)) StartW, endW = editor.findText(FINDOPTION.WHOLEWORD, 0, lenFile, targetString ) Line = editor.getLine(lineNmbr).replace('\r\n', '') LineNmbr = editor.lineFromPosition(startW) #ssageBox(stringToBeMoved ' not found') StartW, endW = editor.findText(FINDOPTION.WHOLEWORD, 0, lenFile, stringToBeMoved) This is mustard after the meal as we say in Dutch, but here is another solution to your problem: # -*- coding: utf-8 -*-įrom _future_ import print_function # Python 2.7ĭef moveLine(stringToBeMoved, targetString):
0 Comments
Leave a Reply. |