AI脚本分割文本框教程 脚本的作用
网站建设 2021-07-03 16:32www.dzhlxh.cn网站建设
这篇教程教狼蚁SEO的朋友们用AI脚本分割文本框,看图就明白这个脚本的作用了:
OK来看这个效果是怎么弄的。该脚本可以将点文字、区域文字(段落文字)中做过分段的文本分为单独的段落。
要用“文件-脚本”来使用,以CS3为例应放在"C:\Program Files\Adobe\Adobe 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 ( john@wundes.com ) 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;
//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 ( john@wundes.com ) 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;
以上就是AI脚本分割文本框教程,谢谢大家喜欢!