Hi Folks,
I'm trying [without luck] to create a script. My intention is to make an alphabet version of the Insert Number command in column mode (A,B,C...).
My attempt might not be worth your time as I'm not much of a programmer just yet. Still, I'm including something to give you an idea of what I'm try to achieve. Is there anyone who would like to help and undertake this challenge? Would this script be useful for anyone else?
It might even be cooler to have an input dialog to begin the script that asks for the first letter in the series (i.e. to begin from E, the [4]th item in Alph), but this is just something fun to consider for those who enjoy writing scripts. I enjoy the simple ones I can do, but this is all as beyond me. Any help you can offer in approaching a workable script would be wonderful!
Thanks,
Rick
I'm trying [without luck] to create a script. My intention is to make an alphabet version of the Insert Number command in column mode (A,B,C...).
My attempt might not be worth your time as I'm not much of a programmer just yet. Still, I'm including something to give you an idea of what I'm try to achieve. Is there anyone who would like to help and undertake this challenge? Would this script be useful for anyone else?
Code: Select all
if columnMode { /* only run if in column mode (and I want to enforce that more than 1 line is selected)*/
var thelines = UltraEdit.activeDocument.selection; /* need to count how many lines are selected in column mode, though no characters are actually selected-- it's just the thin Column line; Word Count counts lines like this */
var rows = thelines.length; /* and then capture that line count into variable "rows" */
var Alph = new Array();
Alph = [A,B,C,D,E,F,G,H,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z]; /* is this how to make an array? might include AA,AB,AC, etc. if this is a good approach and not too slow */
for (var i = 0; i < rows.length; i++) {
UltraEdit.activeDocument.write(Alph[i]); /* output the first character "A" */
UltraEdit.activeDocument.gotoLineSelect(1,0); /* go to the next line in the column, loop */
}
}
Thanks,
Rick