萬盛學電腦網

 萬盛學電腦網 >> 圖文處理 >> Adobe Illustrator教程 >> AI腳本分割文本框

AI腳本分割文本框

這篇教程教朋友們用ai腳本分割文本框,看圖就明白這個腳本的作用了:AI腳本分割文本框  三聯

ok來看這個效果是怎麼弄的。該腳本可以將點文字、區域文字(段落文字)中做過分段的文本分為單獨的段落。

要用“文件-腳本”來使用,以cs3為例應放在"c:program filesadobeadobe illustrator cs3預設腳本"下。
當然,也可以放置在其他文件夾中,通過ctrl+f12定位到腳本所在處來使用。
使用時首先應選中相應文本,然後再選擇該腳本即可分為單獨的段落。

經測試,該腳本在cs3、cs4上依然能夠使用。尊重作者,請勿刪除版權信息!
復制以下全部文字到記事本中,保存為以.js結尾的腳本文件(如:腳本.js)即可。

/////////////////////////////////////////////////////////////////
//divide textframe v.2 -- cs,cs2
//>=--------------------------------------
// divides a multiline text field into separate textframe objects.
// basically, each line in the selected text object
// becomes it's own textframe. vertical spacing of each new line is based on leading.
//
// this is the opposite of my "join textframes" scripts which
// takes multiple lines and stitchs them back together into the same object.
//>=--------------------------------------
// js code (c) copyright: john wundes ( [email protected] ) www.wundes.com
//copyright full text here: http://www.wundes.com/js4ai/copyright.txt
//////////////////////////////////////////////////////////////////

if(activedocument.selection[0].contents.indexof("n") != -1){
//alert("this is already a single line object!");
}else{
//get object position
//make array
var linearr = fieldtoarray(activedocument.selection[0]);
//alert(linearr);
tftop = activedocument.selection[0].top;
tfleft = activedocument.selection[0].left;

copyright © 萬盛學電腦網 all rights reserved