Add the same amount to every selected value?
-
@diz-hydron said in Add the same amount to every selected value?:
Is my understanding of that part correct?
Sounds right, although for sure don’t bother with the shortcut key thing right out of the box. That would only be useful if this whole thing actually works for you, and if you need to do it multiple times. Just run the script from the menus to start with.
-
@neil-schipper said in Add the same amount to every selected value?:
he is a rapper by night,
I have never been accused of that particular moonlighting before…
Is my understanding of that part correct?
That seems a reasonable summary of the process.
If nothing happens, I would tell PythonScript to show the console, and you can look to see if there is an error message.
-
Hello, @diz-hydron and All,
Well, @diz-hydron, I suppose you could begin with this very simple script, named
diz.py
def player_1(m): return str(int(m.group(1)) + X1) + ', ' + str(int(m.group(2)) + Y1) def player_2(m): return str(int(m.group(1)) + X2) + ', ' + str(int(m.group(2)) + Y2) editor.rereplace('"player1": \\[\K(-?[0-9]+), (-?[0-9]+)', player_1); editor.rereplace('"player2": \\[\K(-?[0-9]+), (-?[0-9]+)', player_2);
Before running the script, of course, change the
X1
,Y1
,X2
andY2
values for true positive or negative integers ( e.g.+7
or-3
)It should work nicely with your text posted here
In a next step, it would be better to enter the different values with, for instance, the
notepad.prompt
python command and assign the4
typed numbers to theX1
,X1
,X2
andY2
variables…Best Regards,
guy038