Home Download Buy Blog Forum Support

PY REQUEST: Loop down till column content has change

PY REQUEST: Loop down till column content has change

Postby Jim on Wed Jul 02, 2014 10:25 am

Hi community,

I need support by creating a python script, maybe someone of you can aid me please?



Pseudo code
Code: Select all
if (selection) Then
    RevColumn = current start column
    RevContent = sel.text(selection) whole selected text
else
    RevColumn = current column
    RevContent = sel.text(RevColumn) sign next to cursor


Loop
    CurrContent = sel.text(RevColumn)
    if CurrContent  <> RevContent Then
         GoToBOL
         AddNewLine
         End


Usage:
- Select one sign, here the "7" of "AppID\{7C2D11F6" , or select a word / a short string
- execute script

Result:
- If content of this column has changed first time in lines below, add a blank line and end script:

Example:
Note: cursor and selection are indicated here by pipe signs ||
Code: Select all
HKLM\SOFTWARE\Classes\AppID\{||7||C2D11F6-6EA4-4275-BB84-7AE172AE2D45}\="D  <<<<< SELECT the "7"
HKLM\SOFTWARE\Classes\AppID\{7C2D11F6-6EA4-4275-BB84-7AE172AE2D45}\App
HKLM\SOFTWARE\Classes\AppID\{7C2D11F6-6EA4-4275-BB84-7AE172AE2D45}\Dll
HKLM\SOFTWARE\Classes\AppID\{83D2BB49-1D2C-4B80-B5F1-D6AEAF01345A}\="M
HKLM\SOFTWARE\Classes\AppID\{AD492325-35DF-41F3-B423-AA29ED452454}\="M


Code: Select all
HKLM\SOFTWARE\Classes\AppID\{7C2D11F6-6EA4-4275-BB84-7AE172AE2D45}\="D
HKLM\SOFTWARE\Classes\AppID\{7C2D11F6-6EA4-4275-BB84-7AE172AE2D45}\App
HKLM\SOFTWARE\Classes\AppID\{7C2D11F6-6EA4-4275-BB84-7AE172AE2D45}\Dll
||   <<<<<  NEW LINE ADDED
HKLM\SOFTWARE\Classes\AppID\{83D2BB49-1D2C-4B80-B5F1-D6AEAF01345A}\="M
HKLM\SOFTWARE\Classes\AppID\{AD492325-35DF-41F3-B423-AA29ED452454}\="M



Thanks in advance.
Jim (on Windows Win7, now finally with ST3)
Jim
 
Posts: 40
Joined: Sun Feb 26, 2012 5:21 pm

Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 12 guests