Animation + Save for web accessible from javascript ?


hello.

 

i'm quite new scripting in cs4. did little script illustrator artboards available gif files :

 

/********************************************************** fr32c exporter les plans de travail en gif. *********************************************************/ if (app.documents.length>0){           var docref = app.activedocument;      var numartboards = docref.artboards.length;      var destfolder = folder.selectdialog('select folder export psd files to:');       if (destfolder) {           for (i=0; i<numartboards;i++){                var me = docref.artboards.setactiveartboardindex(i);                var exportoptions = new exportoptionsgif();                 var type = exporttype.gif;                 var filespec = new file(destfolder+"/"+docref.name+i+".gif");                 exportoptions.antialiasing = false;                 exportoptions.colorcount = 64;                 exportoptions.colordither = colordithermethod.diffusion;                 exportoptions.artboardclipping = true;                app.activedocument.exportfile( filespec, type, exportoptions );            }                           }                } 

 

that's ok moment helps me send animation frame frame photoshop. i'd go step further :

i'd load gif files in photoshop, (i can script "open in stack"), make animation, , export web animated gif.

 

the problem find no access animation panel in sdk, nor animation setups in save web window, via javascript too...

 

any clue welcome.

 

(i can still hand or action script in photoshop, sounds more problem accessing illustrator...)

 

thank you.

 

franck

hello, again.

 

still no news on way connect gif, took time improve first script.

 

requires illustrator , cs4.

 

you can save artboards gif files, specifying antialiasing, transparency, number of color , dither mode.

 

hope helps.

 

***edit***

seems cannot upload files, might copypaste

 

/**  * @usage: save artboards gif files, specifying antialiasing, transparency, number of color , dither mode.  * @param: none  */   function createdialog() {      var dlg = new window('dialog', 'artboards > gif');      dlg.description = dlg.add('statictext', undefined, 'enregistrer les plans \rde travail au format gif',{multiline:true});       dlg.msgpnl = dlg.add('panel', undefined, 'caractéristiques');        dlg.msgpnl.coul = dlg.msgpnl.add('group');      dlg.msgpnl.coul.coulst = dlg.msgpnl.coul.add('statictext', undefined, 'couleurs :');       dlg.msgpnl.coul.coulet = dlg.msgpnl.coul.add('edittext', undefined, '32');       dlg.msgpnl.lissage = dlg.msgpnl.add('checkbox', undefined, 'lissage');       dlg.msgpnl.lissage.value = true;       dlg.msgpnl.transp = dlg.msgpnl.add('checkbox', undefined, 'transparence');       dlg.msgpnl.transp.value = false;       dlg.msgpnl.dither = dlg.msgpnl.add('dropdownlist', undefined, 'colordithermethod', {numberofcolumns: 1, showheaders: true, columntitles: ['first name']});      var item1 = dlg.msgpnl.dither.add ('item', 'diffusion'); //diffusion      var item2 = dlg.msgpnl.dither.add ('item', 'sans tramage');//noreduction      var item3 = dlg.msgpnl.dither.add ('item', 'bruit');//noise      var item4 = dlg.msgpnl.dither.add ('item', 'motif');//patterndither       dlg.buildbtn = dlg.add('button', undefined, 'enregistrer', {name:'ok'});      dlg.cancelbtn = dlg.add('button', undefined, 'annuler', {name:'cancel'});       return dlg; } function exportartboardsgiffr(){           if (app.documents.length>0){                var docref = app.activedocument;           var numartboards = docref.artboards.length;           var destfolder = folder.selectdialog('select folder export psd files to:');            if (destfolder) {                for (i=0; i<numartboards;i++){                     var me = docref.artboards.setactiveartboardindex(i);                     var exportoptions = new exportoptionsgif();                      var type = exporttype.gif;                      var filespec = new file(destfolder+"/"+docref.name+i+".gif");                      exportoptions.antialiasing = fenetre.msgpnl.lissage.value;                     exportoptions.transparency = fenetre.msgpnl.transp.value;                     exportoptions.colorcount = fenetre.msgpnl.coul.coulet.text;                       var nombre = fenetre.msgpnl.dither.selection;                      switch (nombre.valueof()) {                           case 0:                           exportoptions.colordither = colordithermethod.diffusion;                           break;                           case 1:                           exportoptions.colordither = colordithermethod.noreduction;                           break;                           case 2:                           exportoptions.colordither = colordithermethod.noise;                           break;                           case 3:                           exportoptions.colordither = colordithermethod.patterndither;                           break;                          default:                          alert('apresswitch '+nombre+' '+exportoptions.colordither);                      }                       exportoptions.artboardclipping = true;                     app.activedocument.exportfile( filespec, type, exportoptions );                 }                      }                     } } var fenetre = createdialog();  with(fenetre){      msgpnl.dither.selection = 2; } fenetre.show();  alert('vous allez enregistrer vos plans de travail au format gif avec '+(fenetre.msgpnl.coul.coulet.text)+' couleurs, en mode de diffusion '+fenetre.msgpnl.dither.selection+', avec lissage : '+fenetre.msgpnl.lissage.value+' et transparence : '+fenetre.msgpnl.transp.value+' et écraser les fichiers précédents.');  exportartboardsgiffr(); 



More discussions in Photoshop Plugin and Companion App SDK


adobe

Comments

Popular posts from this blog

Flip address is out of range arduino uno r3

Arduino Uno not uploading

Indesign and MathType fonts