• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Spiral "Shrinking" Text Script

Community Beginner ,
May 07, 2017 May 07, 2017

Copy link to clipboard

Copied

Good day all,

Reaching out to experts to see if anyone can assist to update this script to work with new CC Illustrator.

This is an older script which i came across years ago,

ChangeSizesOfTextSelection.js

and made the 2 small changes suggested by Larry G. Schneider

if (pageItemType == "TextArtItem")

change to

if (pageItemType == "TextFrame")

and

theTextRange = pageObject.textRange();

change to

theTextRange = pageObject.textRange;

Yet this will not function properly on CC2014 as I get an error every time i try to run this.

I love the effects of this and seeing if someone can help update or fix so this works on newer versions. Below is link to original post.

THANKS MUCH in advance for anyone that can help.

Views

8.7K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
May 07, 2017 May 07, 2017

Copy link to clipboard

Copied

I remember that script from way back. Try this:

  1. // CharSizeChangeFromFirst2LastInProportion.jsx 
  2.  
  3. // http://forums.adobe.com/thread/1414597?tstart=0 
  4.  
  5. // select a text frame or pathtext before running this script  
  6. // test this script at first with only a few characters! 
  7. // The more letters, the longer it takes 
  8.  
  9. // If the screen seems to be frozen - please wait for a while 
  10.  
  11. // regards pixxxelschubser  25/Febr./2014 
  12.  
  13. var aDoc = app.activeDocument; 
  14. if (aDoc.selection.length > 0) { 
  15.     if (aDoc.selection.length < 2 && aDoc.selection[0].typename == "TextFrame") { 
  16.         var aTFrame = aDoc.selection[0]; 
  17.         var theChars = aTFrame.characters; 
  18.         var charLength = theChars.length; 
  19.         var startSize = prompt("size of first character", 25,"start size"); 
  20.         var endSize = prompt("size of last character", 5,"end size"); 
  21.         var step = (startSize-endSize)/(charLength-1); 
  22.         for (i = 0; i < charLength; i++) { 
  23.             theChars.size = (startSize - i*step).toFixed (2); 
  24.             redraw(); 
  25.             } 
  26.         } else {alert("Please select only one text frame")} 
  27.     } else {alert("No selection")}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 09, 2017 May 09, 2017

Copy link to clipboard

Copied

John Wundes' TextTweaker script can do that and many other things: wundes.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
May 09, 2017 May 09, 2017

Copy link to clipboard

Copied

Hi razo.ad1985,

I believe the suggestions above are great and it should get your desired output. In case you need further assistance, I would suggest you to check Illustrator Scripting​ forum as well for dedicated Scripting support.

Regards,

Om

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
May 10, 2017 May 10, 2017

Copy link to clipboard

Copied

https://forums.adobe.com/thread/1414597?tstart=0

razo.ad1985 reply #2

“i borrowed second image from online as looked similar to what i am trying to achieve....”

I did that Illustrator file over 10 years ago and posted on another forum.

I just tested my script. Still works. (YIPPEE)

• macOS Sierra (version 10.12.4)

• Illustrator CC 2017 (version 21.1.0)

As I recall from long ago, I modified a script that came shipped with maybe CS2.

I made a new script, SizeTextOneDirection.js

I am NOT a scripting person!

I opened the script using Text Edit app.

Here is the text for SizeTextOneDirection.js

selection = app.activeDocument.selection;

for(i=0, scale=100.0; i< selection.characters.length; i++, scale *= 0.99) {

selection.characters.characterAttributes.horizontalScale = scale;

selection.characters.characterAttributes.verticalScale = scale; }.

Here is my sample file created with Illustrator CC 2017 (version 21.1.0)

Set your text.

With the Text Tool, select all your text, run the script SizeTextOneDirection.js

Copy your text, Paste on a path. (Text on a Path)

Hope that helps.

Kkb_SizeText on Spiral.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 19, 2020 Feb 19, 2020

Copy link to clipboard

Copied

Thank you, but is this the full code?
I think no. Does't works for me.
Please write the full text.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 12, 2021 Jan 12, 2021

Copy link to clipboard

Copied

  1. // CharSizeChangeFromFirst2LastInProportion.jsx 
  2.  
  3. // http://forums.adobe.com/thread/1414597?tstart=0 
  4.  
  5. // select a text frame or pathtext before running this script  
  6. // test this script at first with only a few characters! 
  7. // The more letters, the longer it takes 
  8.  
  9. // If the screen seems to be frozen - please wait for a while 
  10.  
  11. // regards pixxxelschubser  25/Febr./2014 
  12.  
  13. var aDoc = app.activeDocument; 
  14. if (aDoc.selection.length > 0) { 
  15.     if (aDoc.selection.length < 2 && aDoc.selection[0].typename == "TextFrame") { 
  16.         var aTFrame = aDoc.selection[0]; 
  17.         var theChars = aTFrame.characters; 
  18.         var charLength = theChars.length; 
  19.         var startSize = prompt("size of first character"25,"start size"); 
  20.         var endSize = prompt("size of last character"5,"end size"); 
  21.         var step = (startSize-endSize)/(charLength-1); 
  22.         for (i = 0; i < charLength; i++) { 
  23.             theChars[i].size = (startSize - i*step).toFixed (2); 
  24.             redraw(); 
  25.             } 
  26.         } else {alert("Please select only one text frame")} 
  27.     } else {alert("No selection")}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 02, 2021 Apr 02, 2021

Copy link to clipboard

Copied

I receive an error code when I try to run the script after restarting Illustrator and adding it to the script folder. Is there a work around for this? I'm not a script person so I'm way out of my element here! Appreciate the help in advance!

Screen Shot 2021-04-02 at 4.55.14 PM.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 02, 2021 Apr 02, 2021

Copy link to clipboard

Copied

Do not copy unnecessary parts (the numbers at the beginning of each line of code)

 

Try this:

 

// CharSizeChangeFromFirst2LastInProportion.jsx

// https://community.adobe.com/t5/illustrator/illustrator-spiral-shrinking-growin-text-scaling-down-up-on-spiral-path/m-p/10998741?page=1#M170469
// http://forums.adobe.com/thread/1414597?tstart=0

// select a text frame or pathtext before running this script 
// test this script at first with only a few characters!
// The more letters, the longer it takes

// If the screen seems to be frozen - please wait for a while

// regards pixxxelschubser  25/Febr./2014

var aDoc = app.activeDocument;
if (aDoc.selection.length > 0) {
    if (aDoc.selection.length < 2 && aDoc.selection[0].typename == "TextFrame") {
        var aTFrame = aDoc.selection[0];
        var theChars = aTFrame.characters;
        var charLength = theChars.length;
        var startSize = prompt("size of first character", 25,"start size");
        var endSize = prompt("size of last character", 5,"end size");
        var step = (startSize-endSize)/(charLength-1);
        for (i = 0; i < charLength; i++) {
            theChars[i].size = (startSize - i*step).toFixed (2);
            redraw();
            }
        } else {alert("Please select only one text frame")}
    } else {alert("No selection")}

 

 

If that works for you

have fun

😉

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 02, 2021 Apr 02, 2021

Copy link to clipboard

Copied

Yes! That worked beautifully! Thanks for the quick reply and helping out an inexperienced non-scripter! 🙂

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 18, 2022 May 18, 2022

Copy link to clipboard

Copied

How do you save the script you posted? I copied it and pasted it into Text Edit and also tried Script Editor, but know the format to save it in. I did a search on scripts for Illustrator and it mentioned javascript (.js), but neither program gives me that option.

Thanks,

John

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 18, 2022 May 18, 2022

Copy link to clipboard

Copied

LATEST

In TextEdit make a new document and choose Format > Make Plain Text.

Paste the script and save it with the extension .js or .jsx

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines