ばらばらにしましょう。

最終更新日

Comments: 0

今日CSSDKチームからパブリックコメントが出てました。すこし、引用してみましょう。
Based on the above, I would like to state that:
●The Creative Suite SDK and CS Extension Builder will continue to be developed and enhanced with new features and support for Creative Suite applications.
●We will make CS Extension Builder available through the Adobe Store at a compelling price point. We want the tool to become broadly available, so that every Creative Suite developer can enjoy its benefits
●We will continue our investigation on new technologies (e.g. HTML5) for extension development and occasionally share our findings with the developer community. We want to be transparent with the community and keep you involved in our planning.
We are firm believers that the CS extensibility story will continue to evolve as it has been doing for several years. Our ongoing goal is to make this story compelling for you by providing best of class development and distribution tools and help you reach as many customers as possible. Ultimately, your success is our success!
と言う具合にひとまず当面エクステンション周りの変更はなくて、このままCSSDKは開発が続けられ、AdobeStoreでの販売も視野に入っているみたいです。やれやれw

話は全く関連しませんが、一番の問題はくりえいてぃぶくらうどなるものをどう捉えるかってことです。もう少し安くしてもらうかサービス内容を考慮してほしいものです。またまた話は飛びますが、いろいろ書きたい事はあれどconfidentialの一言に負けてしまう訳です。まあ半年程お待ち下さい。それよりも先にCSXSライブラリの詳細な解説を先にやるかもしれませんが。のらりくらりとやっていますが、今回も内容が薄い為です。それでは本題に入りましょう。
なんて事はありません。AI上でテキストを操作している時にボディのサイズがさらりと取得出来る事に今更ながら気付いたのでこんなんやってみました。

var a = app.activeDocument.selection[0];
var num = a.paragraphs.length-1;
for (var i=num;i>=0;i--){
    b = a.duplicate ();
    h1 = a.height;
    a.paragraphs[i].remove();
    for (var j=i-1;j>=0;j--) b.paragraphs[j].remove();
    h2 = b.height;
    b.position = [a.position[0], a.position[1]-h1+h2];
    splitter (b);
    }

function splitter(para){
    if (para.characters.length<2) return;
    var chr,y;
    for (var k=para.characters.length-1;k>=0;k--){
        chr = para.duplicate();
        y = para.position[1];
        for (var j=chr.characters.length-2;j>=0;j--) chr.characters[j].remove();
        para.characters[k].remove();
        if (para.height>chr.height) y =  y - para.height + chr.height;
        chr.position = [para.position[0]+para.width, y];
        }
    para.remove();
    }

解説もおこがましい程に単純です。実行結果はこちら

テキストがキャラクター毎に分解されます。単純に後ろからバラバラにしていくのですが、座標を得る為にparagraphsオブジェクトのwidthとheightプロパティを参照します。

ten_a

Graphic Designer, Scripter and Coder. Adobe Community Professional.

シェアする

コメントを残す