◆ 网页平面多媒体培训、认证考试免费咨询热线:400-700-5807 进入网络咨询平台 ◆
这个基本的技术使你可以自动操作任何大量的不同任务。这里有一个使用位图Lingo把所有32位的位图转换成16位的例子,保留了注册点: on transformbitmaps lib if voidp (lib) then lib= the activecastlib s=castlib (lib).selection repeat with lyst in s repeat with i = lyst[1] to lyst[2] mem = member (i, lib) if mem.type <> #bitmap then next repeat im = mem.image if im.depth = 32 then im2=image (im.width, im.height, 16) im2.copypixels (im, im.rect, im.rect) reg = mem.regpoint mem.image = im2 mem.regpoint = reg end if end repeat end repeat end
附带的说一句,这个脚本用了member.type 属性来检查某成分是否被看成是一个位图。这样的检查通常很有用。这里是这种模型的最后一个例子:写一个程序去转换你所有的文本text成员到field成员, 保留基本的格式。这里用一些新的命令创建一个全新的计算成分,一项非常强大的技术。
脚本里也包含了两个附加的选项:是否保留一份原始成分的副本,和新的域是否应该和原始成分放在同一计算成分位置里。这两项默认为是。 on converttofield lib, retain, sameplace if voidp (lib) then lib = the activecastlib if voidp (retain) then retain = 1 if voidp (sameplace) then sameplace = 1 s=castlib (lib).selection repeat with lyst in s repeat with i = lyst[1] to lyst[2] mem=member (i, lib) if mem.type <> #text then next repeat if sameplace then newmem = new (#text) newmem.media = mem.media newmem.name = mem.name erase mem mem=newmem f=new (#field, member (i, lib)) else f = new (#field) end if f.text = mem.text f.rect=mem.rect f.alignment = string (mem.alignment) f.name = mem.name repeat with k = 1 to mem.text.length the font of char k of field f = mem.char[k].font the fontsize of char k of field f = mem.char[k].fontsize s = mem.char[k].fontstyle tx = '''' repeat with sym in s tx = tx & sym & '','' end repeat if tx.length > 0 then delete tx.char[tx.length] the fontstyle of char k of field f = tx end if end repeat if not retain then erase mem end repeat end repeat end
选择你感兴趣的CAST成员不是进行复杂搜索的唯一方法,顺便一提-Lingo 存诸了CAST成员的所有工具。你可以用creationDate 属性去改变上个星期才输入的CAST成员,或是用modifiedBy 属性去改变那些还没有被修改过的CAST。
上一页 [1] [2] [3] 下一页
 【责编:Youping】 |