# Logarithmic Spacing in Illustrator

I'm trying to space text logarithmically. My goal is essentially the same as the one presented here, which is useful but doesn't help me as the only advice provided is to use JS, which I'm not familiar enough with to write something like this in from scratch, let alone in Illustrator.

Here is some code linked in the answer I'm referring to (JSFiddle):

function log10(val) {
return Math.log(val) / Math.LN10;
}
var paper = Raphael('meh', 1000,1000);
for (var i = 1; i <= 100; i++) {
var log = log10(i) * 125;
var yPos = 260 - log;
var r = paper.rect(0,yPos,5,1,1);
if (i==1 || i==10 || i==100) {
paper.text(15,yPos,i);
}
r.attr({opacity: 0.6, 'stroke-width': 0, fill: '#000000'});
console.log(yPos);
};


Credit: user568458

My first thought was to use a blend and replace the spine, but as I'm using outlined text, that wouldn't work. It would blend between the letters as well as space them but that's not what I want. I need the letterforms to stay intact.

If someone could help me adapt this code to a script that I could run in Illustrator I would appreciate it. I would need to be able to input custom values to control the spacing each time I ran the script.

EDIT: Thanks for the replies so far. Here's an image of what I'd like to accomplish. I placed these letters by hand using the logarithmic grid tool in illustrator, but I have several hundred characters of text I'd like to set with varying bases to achieve different spacings.

• Can you put an image of your desired result? For example, are you spacing different letters or the same letters? Vertically? Only in black color? – Silly-V Apr 26 '17 at 16:57
• Illustrator javascript is not the same thing as normal javascript sp none of the web programming API thing applies. – joojaa Apr 26 '17 at 17:17

#target illustrator

function log10(val) {
return Math.log(val) / Math.LN10;
}

docRef=app.activeDocument;
for (var i = 1; i <= 20; i++) {