Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Scriptlistener: scripting save as GIF with loop endless and file name as layer name

Explorer ,
Jul 21, 2017 Jul 21, 2017

I have script to export to animated GIF that gives

the file name after the name of the selected Photoshop layer.

It works fine but Looping options is always

set to "ONCE". I need looping to be set "FOREVER".

To solve the problem I am trying to use scriptlistener.

The scriptlistener produces proper .GIF with loop

endless BUT I cannot integrate it properly into

my script that sets the name of the file as

the name of the currently selected layer.

I think the problem is that with scriptlistener

I am using Save For WEB to produce GIF file with

Looping Options: forever. So it just overrides

the file name with new always the same name!

Is there any other way to set loop forever except 

Save For WEB function? What should I log by scriptlistener?

Or how I can use scriptlistener's log in this my script?

PLEASE HELP!!! WOULD BE VERY GRATEFULL!!!

------- here is my script -----------

#target photoshop

main();

function main(){

if(!documents.length) return;

try{

var Path= activeDocument.path;

}catch(e){var Path = "~/desktop";}

var Name = decodeURI(app.activeDocument.name).replace(/\.[^\.]+$/, '');

var layerName = app.activeDocument.activeLayer.name.replace(/[:\/\\*\?\"\<\>\|]/g, "_");

var saveFile= new File(Path + "/" + Name + "-" + layerName + ".gif");

SaveForWeb(saveFile);

}

function SaveForWeb(saveFile) {

var sfwOptions = new ExportOptionsSaveForWeb();

   sfwOptions.format = SaveDocumentType.COMPUSERVEGIF;

   sfwOptions.includeProfile = false;

   sfwOptions.interlaced = 1;

   sfwOptions.optimized = true;

   sfwOptions.transparency = 1;

   sfwOptions.ColorReductionType = ColorReductionType.SELECTIVE;

   sfwOptions.dither = Dither.NONE;  

   sfwOptions.ditherAmount = 80;

   sfwOptions.webSnap = 0;

   sfwOptions.colors = 128;

activeDocument.exportDocument(saveFile, ExportType.SAVEFORWEB, sfwOptions);

}

--------- END of my script -------------------

----------here is

#target photoshop

main();

function main(){

if(!documents.length) return;

try{

var Path= activeDocument.path;

}catch(e){var Path = "~/desktop";}

var Name = decodeURI(app.activeDocument.name).replace(/\.[^\.]+$/, '');

var layerName = app.activeDocument.activeLayer.name.replace(/[:\/\\*\?\"\<\>\|]/g, "_");

var saveFile= new File(Path + "/" + Name + "-" + layerName + ".gif");

makeGif(saveFile);

}

function makeGif(saveFile){ 

// ======================================================= 

var idExpr = charIDToTypeID( "Expr" ); 

    var desc3 = new ActionDescriptor(); 

    var idUsng = charIDToTypeID( "Usng" ); 

        var desc4 = new ActionDescriptor(); 

        var idOp = charIDToTypeID( "Op  " ); 

        var idSWOp = charIDToTypeID( "SWOp" ); 

        var idOpSa = charIDToTypeID( "OpSa" ); 

        desc4.putEnumerated( idOp, idSWOp, idOpSa ); 

        var idDIDr = charIDToTypeID( "DIDr" ); 

        desc4.putBoolean( idDIDr, true ); 

        var idIn = charIDToTypeID( "In  " ); 

        desc4.putPath( idIn, new File( "D:\\==Result\\10-10" ) ); 

        var idovFN = charIDToTypeID( "ovFN" ); 

        desc4.putString( idovFN, saveFile );//new line 

//        desc4.putString( idovFN, """capricia2.gif""" ); Old line 

        var idFmt = charIDToTypeID( "Fmt " ); 

        var idIRFm = charIDToTypeID( "IRFm" ); 

        var idGIFf = charIDToTypeID( "GIFf" ); 

        desc4.putEnumerated( idFmt, idIRFm, idGIFf ); 

        var idIntr = charIDToTypeID( "Intr" ); 

        desc4.putBoolean( idIntr, true ); 

        var idRedA = charIDToTypeID( "RedA" ); 

        var idIRRd = charIDToTypeID( "IRRd" ); 

        var idSltv = charIDToTypeID( "Sltv" ); 

        desc4.putEnumerated( idRedA, idIRRd, idSltv ); 

        var idRChT = charIDToTypeID( "RChT" ); 

        desc4.putBoolean( idRChT, false ); 

        var idRChV = charIDToTypeID( "RChV" ); 

        desc4.putBoolean( idRChV, false ); 

        var idAuRd = charIDToTypeID( "AuRd" ); 

        desc4.putBoolean( idAuRd, false ); 

        var idNCol = charIDToTypeID( "NCol" ); 

        desc4.putInteger( idNCol, 128 ); 

        var idDChS = charIDToTypeID( "DChS" ); 

        desc4.putInteger( idDChS, 0 ); 

        var idDCUI = charIDToTypeID( "DCUI" ); 

        desc4.putInteger( idDCUI, 0 ); 

        var idDChT = charIDToTypeID( "DChT" ); 

        desc4.putBoolean( idDChT, false ); 

        var idDChV = charIDToTypeID( "DChV" ); 

        desc4.putBoolean( idDChV, false ); 

        var idWebS = charIDToTypeID( "WebS" ); 

        desc4.putInteger( idWebS, 0 ); 

        var idTDth = charIDToTypeID( "TDth" ); 

        var idIRDt = charIDToTypeID( "IRDt" ); 

        var idPtrn = charIDToTypeID( "Ptrn" ); 

        desc4.putEnumerated( idTDth, idIRDt, idPtrn ); 

        var idTDtA = charIDToTypeID( "TDtA" ); 

        desc4.putInteger( idTDtA, 100 ); 

        var idLoss = charIDToTypeID( "Loss" ); 

        desc4.putInteger( idLoss, 0 ); 

        var idLChS = charIDToTypeID( "LChS" ); 

        desc4.putInteger( idLChS, 0 ); 

        var idLCUI = charIDToTypeID( "LCUI" ); 

        desc4.putInteger( idLCUI, 100 ); 

        var idLChT = charIDToTypeID( "LChT" ); 

        desc4.putBoolean( idLChT, false ); 

        var idLChV = charIDToTypeID( "LChV" ); 

        desc4.putBoolean( idLChV, false ); 

        var idTrns = charIDToTypeID( "Trns" ); 

        desc4.putBoolean( idTrns, true ); 

        var idMtt = charIDToTypeID( "Mtt " ); 

        desc4.putBoolean( idMtt, false ); 

        var idDthr = charIDToTypeID( "Dthr" ); 

        var idIRDt = charIDToTypeID( "IRDt" ); 

        var idNone = charIDToTypeID( "None" ); 

        desc4.putEnumerated( idDthr, idIRDt, idNone ); 

        var idDthA = charIDToTypeID( "DthA" ); 

        desc4.putInteger( idDthA, 54 ); 

        var idMttR = charIDToTypeID( "MttR" ); 

        desc4.putInteger( idMttR, 255 ); 

        var idMttG = charIDToTypeID( "MttG" ); 

        desc4.putInteger( idMttG, 255 ); 

        var idMttB = charIDToTypeID( "MttB" ); 

        desc4.putInteger( idMttB, 255 ); 

        var idSHTM = charIDToTypeID( "SHTM" ); 

        desc4.putBoolean( idSHTM, false ); 

        var idSImg = charIDToTypeID( "SImg" ); 

        desc4.putBoolean( idSImg, true ); 

        var idSWsl = charIDToTypeID( "SWsl" ); 

        var idSTsl = charIDToTypeID( "STsl" ); 

        var idSLAl = charIDToTypeID( "SLAl" ); 

        desc4.putEnumerated( idSWsl, idSTsl, idSLAl ); 

        var idSWch = charIDToTypeID( "SWch" ); 

        var idSTch = charIDToTypeID( "STch" ); 

        var idCHsR = charIDToTypeID( "CHsR" ); 

        desc4.putEnumerated( idSWch, idSTch, idCHsR ); 

        var idSWmd = charIDToTypeID( "SWmd" ); 

        var idSTmd = charIDToTypeID( "STmd" ); 

        var idMDCp = charIDToTypeID( "MDCp" ); 

        desc4.putEnumerated( idSWmd, idSTmd, idMDCp ); 

        var idohXH = charIDToTypeID( "ohXH" ); 

        desc4.putBoolean( idohXH, false ); 

        var idohIC = charIDToTypeID( "ohIC" ); 

        desc4.putBoolean( idohIC, true ); 

        var idohAA = charIDToTypeID( "ohAA" ); 

        desc4.putBoolean( idohAA, true ); 

        var idohQA = charIDToTypeID( "ohQA" ); 

        desc4.putBoolean( idohQA, true ); 

        var idohCA = charIDToTypeID( "ohCA" ); 

        desc4.putBoolean( idohCA, false ); 

        var idohIZ = charIDToTypeID( "ohIZ" ); 

        desc4.putBoolean( idohIZ, true ); 

        var idohTC = charIDToTypeID( "ohTC" ); 

        var idSToc = charIDToTypeID( "SToc" ); 

        var idOCzerothree = charIDToTypeID( "OC03" ); 

        desc4.putEnumerated( idohTC, idSToc, idOCzerothree ); 

        var idohAC = charIDToTypeID( "ohAC" ); 

        var idSToc = charIDToTypeID( "SToc" ); 

        var idOCzerothree = charIDToTypeID( "OC03" ); 

        desc4.putEnumerated( idohAC, idSToc, idOCzerothree ); 

        var idohIn = charIDToTypeID( "ohIn" ); 

        desc4.putInteger( idohIn, -1 ); 

        var idohLE = charIDToTypeID( "ohLE" ); 

        var idSTle = charIDToTypeID( "STle" ); 

        var idLEzerothree = charIDToTypeID( "LE03" ); 

        desc4.putEnumerated( idohLE, idSTle, idLEzerothree ); 

        var idohEn = charIDToTypeID( "ohEn" ); 

        var idSTen = charIDToTypeID( "STen" ); 

        var idENzerozero = charIDToTypeID( "EN00" ); 

        desc4.putEnumerated( idohEn, idSTen, idENzerozero ); 

        var idolCS = charIDToTypeID( "olCS" ); 

        desc4.putBoolean( idolCS, false ); 

        var idolEC = charIDToTypeID( "olEC" ); 

        var idSTst = charIDToTypeID( "STst" ); 

        var idSTzerozero = charIDToTypeID( "ST00" ); 

        desc4.putEnumerated( idolEC, idSTst, idSTzerozero ); 

        var idolWH = charIDToTypeID( "olWH" ); 

        var idSTwh = charIDToTypeID( "STwh" ); 

        var idWHzeroone = charIDToTypeID( "WH01" ); 

        desc4.putEnumerated( idolWH, idSTwh, idWHzeroone ); 

        var idolSV = charIDToTypeID( "olSV" ); 

        var idSTsp = charIDToTypeID( "STsp" ); 

        var idSPzerofour = charIDToTypeID( "SP04" ); 

        desc4.putEnumerated( idolSV, idSTsp, idSPzerofour ); 

        var idolSH = charIDToTypeID( "olSH" ); 

        var idSTsp = charIDToTypeID( "STsp" ); 

        var idSPzerofour = charIDToTypeID( "SP04" ); 

        desc4.putEnumerated( idolSH, idSTsp, idSPzerofour ); 

        var idolNC = charIDToTypeID( "olNC" ); 

            var list1 = new ActionList(); 

                var desc5 = new ActionDescriptor(); 

                var idncTp = charIDToTypeID( "ncTp" ); 

                var idSTnc = charIDToTypeID( "STnc" ); 

                var idNCzerozero = charIDToTypeID( "NC00" ); 

                desc5.putEnumerated( idncTp, idSTnc, idNCzerozero ); 

            var idSCnc = charIDToTypeID( "SCnc" ); 

            list1.putObject( idSCnc, desc5 ); 

                var desc6 = new ActionDescriptor(); 

                var idncTp = charIDToTypeID( "ncTp" ); 

                var idSTnc = charIDToTypeID( "STnc" ); 

                var idNConenine = charIDToTypeID( "NC19" ); 

                desc6.putEnumerated( idncTp, idSTnc, idNConenine ); 

            var idSCnc = charIDToTypeID( "SCnc" ); 

            list1.putObject( idSCnc, desc6 ); 

                var desc7 = new ActionDescriptor(); 

                var idncTp = charIDToTypeID( "ncTp" ); 

                var idSTnc = charIDToTypeID( "STnc" ); 

                var idNCtwoeight = charIDToTypeID( "NC28" ); 

                desc7.putEnumerated( idncTp, idSTnc, idNCtwoeight ); 

            var idSCnc = charIDToTypeID( "SCnc" ); 

            list1.putObject( idSCnc, desc7 ); 

                var desc8 = new ActionDescriptor(); 

                var idncTp = charIDToTypeID( "ncTp" ); 

                var idSTnc = charIDToTypeID( "STnc" ); 

                var idNCtwofour = charIDToTypeID( "NC24" ); 

                desc8.putEnumerated( idncTp, idSTnc, idNCtwofour ); 

            var idSCnc = charIDToTypeID( "SCnc" ); 

            list1.putObject( idSCnc, desc8 ); 

                var desc9 = new ActionDescriptor(); 

                var idncTp = charIDToTypeID( "ncTp" ); 

                var idSTnc = charIDToTypeID( "STnc" ); 

                var idNCtwofour = charIDToTypeID( "NC24" ); 

                desc9.putEnumerated( idncTp, idSTnc, idNCtwofour ); 

            var idSCnc = charIDToTypeID( "SCnc" ); 

            list1.putObject( idSCnc, desc9 ); 

                var desc10 = new ActionDescriptor(); 

                var idncTp = charIDToTypeID( "ncTp" ); 

                var idSTnc = charIDToTypeID( "STnc" ); 

                var idNCtwofour = charIDToTypeID( "NC24" ); 

                desc10.putEnumerated( idncTp, idSTnc, idNCtwofour ); 

            var idSCnc = charIDToTypeID( "SCnc" ); 

            list1.putObject( idSCnc, desc10 ); 

        desc4.putList( idolNC, list1 ); 

        var idobIA = charIDToTypeID( "obIA" ); 

        desc4.putBoolean( idobIA, false ); 

        var idobIP = charIDToTypeID( "obIP" ); 

        desc4.putString( idobIP, """""" ); 

        var idobCS = charIDToTypeID( "obCS" ); 

        var idSTcs = charIDToTypeID( "STcs" ); 

        var idCSzeroone = charIDToTypeID( "CS01" ); 

        desc4.putEnumerated( idobCS, idSTcs, idCSzeroone ); 

        var idovNC = charIDToTypeID( "ovNC" ); 

            var list2 = new ActionList(); 

                var desc11 = new ActionDescriptor(); 

                var idncTp = charIDToTypeID( "ncTp" ); 

                var idSTnc = charIDToTypeID( "STnc" ); 

                var idNCzeroone = charIDToTypeID( "NC01" ); 

                desc11.putEnumerated( idncTp, idSTnc, idNCzeroone ); 

            var idSCnc = charIDToTypeID( "SCnc" ); 

            list2.putObject( idSCnc, desc11 ); 

                var desc12 = new ActionDescriptor(); 

                var idncTp = charIDToTypeID( "ncTp" ); 

                var idSTnc = charIDToTypeID( "STnc" ); 

                var idNCtwozero = charIDToTypeID( "NC20" ); 

                desc12.putEnumerated( idncTp, idSTnc, idNCtwozero ); 

            var idSCnc = charIDToTypeID( "SCnc" ); 

            list2.putObject( idSCnc, desc12 ); 

                var desc13 = new ActionDescriptor(); 

                var idncTp = charIDToTypeID( "ncTp" ); 

                var idSTnc = charIDToTypeID( "STnc" ); 

                var idNCzerotwo = charIDToTypeID( "NC02" ); 

                desc13.putEnumerated( idncTp, idSTnc, idNCzerotwo ); 

            var idSCnc = charIDToTypeID( "SCnc" ); 

            list2.putObject( idSCnc, desc13 ); 

                var desc14 = new ActionDescriptor(); 

                var idncTp = charIDToTypeID( "ncTp" ); 

                var idSTnc = charIDToTypeID( "STnc" ); 

                var idNConenine = charIDToTypeID( "NC19" ); 

                desc14.putEnumerated( idncTp, idSTnc, idNConenine ); 

            var idSCnc = charIDToTypeID( "SCnc" ); 

            list2.putObject( idSCnc, desc14 ); 

                var desc15 = new ActionDescriptor(); 

                var idncTp = charIDToTypeID( "ncTp" ); 

                var idSTnc = charIDToTypeID( "STnc" ); 

                var idNCzerosix = charIDToTypeID( "NC06" ); 

                desc15.putEnumerated( idncTp, idSTnc, idNCzerosix ); 

            var idSCnc = charIDToTypeID( "SCnc" ); 

            list2.putObject( idSCnc, desc15 ); 

                var desc16 = new ActionDescriptor(); 

                var idncTp = charIDToTypeID( "ncTp" ); 

                var idSTnc = charIDToTypeID( "STnc" ); 

                var idNCtwofour = charIDToTypeID( "NC24" ); 

                desc16.putEnumerated( idncTp, idSTnc, idNCtwofour ); 

            var idSCnc = charIDToTypeID( "SCnc" ); 

            list2.putObject( idSCnc, desc16 ); 

                var desc17 = new ActionDescriptor(); 

                var idncTp = charIDToTypeID( "ncTp" ); 

                var idSTnc = charIDToTypeID( "STnc" ); 

                var idNCtwofour = charIDToTypeID( "NC24" ); 

                desc17.putEnumerated( idncTp, idSTnc, idNCtwofour ); 

            var idSCnc = charIDToTypeID( "SCnc" ); 

            list2.putObject( idSCnc, desc17 ); 

                var desc18 = new ActionDescriptor(); 

                var idncTp = charIDToTypeID( "ncTp" ); 

                var idSTnc = charIDToTypeID( "STnc" ); 

                var idNCtwofour = charIDToTypeID( "NC24" ); 

                desc18.putEnumerated( idncTp, idSTnc, idNCtwofour ); 

            var idSCnc = charIDToTypeID( "SCnc" ); 

            list2.putObject( idSCnc, desc18 ); 

                var desc19 = new ActionDescriptor(); 

                var idncTp = charIDToTypeID( "ncTp" ); 

                var idSTnc = charIDToTypeID( "STnc" ); 

                var idNCtwotwo = charIDToTypeID( "NC22" ); 

                desc19.putEnumerated( idncTp, idSTnc, idNCtwotwo ); 

            var idSCnc = charIDToTypeID( "SCnc" ); 

            list2.putObject( idSCnc, desc19 ); 

        desc4.putList( idovNC, list2 ); 

        var idovCM = charIDToTypeID( "ovCM" ); 

        desc4.putBoolean( idovCM, false ); 

        var idovCW = charIDToTypeID( "ovCW" ); 

        desc4.putBoolean( idovCW, true ); 

        var idovCU = charIDToTypeID( "ovCU" ); 

        desc4.putBoolean( idovCU, true ); 

        var idovSF = charIDToTypeID( "ovSF" ); 

        desc4.putBoolean( idovSF, true ); 

        var idovCB = charIDToTypeID( "ovCB" ); 

        desc4.putBoolean( idovCB, true ); 

        var idovSN = charIDToTypeID( "ovSN" ); 

        desc4.putString( idovSN, """images""" ); 

    var idSaveForWeb = stringIDToTypeID( "SaveForWeb" ); 

    desc3.putObject( idUsng, idSaveForWeb, desc4 ); 

executeAction( idExpr, desc3, DialogModes.NO ); 

}

------- END of scriptlistener ---------------

TOPICS
Actions and scripting
4.9K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Jul 21, 2017 Jul 21, 2017

I just used the scriptlistener get the cod3e recorded for set a frameanimation to loop forever. Here is what I got.

Saved it as Forever.jsx and tested it and it worked.

// =======================================================

var idsetd = charIDToTypeID( "setd" );

    var desc19 = new ActionDescriptor();

    var idnull = charIDToTypeID( "null" );

        var ref3 = new ActionReference();

        var idanimationClass = stringIDToTypeID( "animationClass" );

        var idOrdn = charIDToTypeID( "Ordn" );

        var idTrgt = charIDToTypeID( "Trgt" );

        ref3.putEnumerated( idanimationClass, idOrdn, idTrgt );

    desc19.putReference( idnull, ref3 );

    var idT = charIDToTypeID( "T   " );

        var desc20 = new ActionDescriptor();

        var idanimationLoopEnum = stringIDToTypeID( "animationLoopEnum" );

        var idanimationLoopType = stringIDToTypeID( "animationLoopType" );

        var idanimationLoopForever = stringIDToTypeID( "animationLoopForever" );

        desc20.putEnumerated( idanimationLoopEnum, idanimationLoopType, idanimationLoopForever );

    var idanimationClass = stringIDToTypeID( "animationClass" );

    desc19.putObject( idT, idanimationClass, desc20 );

executeAction( idsetd, desc19, DialogModes.NO );

JJMack
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 21, 2017 Jul 21, 2017

Thank you SOOOOO much, JJMack!!!

I am a newbie! Could you please tell how I can implement your code into my script below?

#target photoshop

main();

function main(){

if(!documents.length) return;

try{

var Path= activeDocument.path;

}catch(e){var Path = "~/desktop";}

var Name = decodeURI(app.activeDocument.name).replace(/\.[^\.]+$/, '');

var layerName = app.activeDocument.activeLayer.name.replace(/[:\/\\*\?\"\<\>\|]/g, "_");

var saveFile= new File(Path + "/" + Name + "-" + layerName + ".gif");

SaveForWeb(saveFile);

}

function SaveForWeb(saveFile) {

var sfwOptions = new ExportOptionsSaveForWeb();

   sfwOptions.format = SaveDocumentType.COMPUSERVEGIF;

   sfwOptions.includeProfile = false;

   sfwOptions.interlaced = 1;

   sfwOptions.optimized = true;

   sfwOptions.transparency = 1;

   sfwOptions.ColorReductionType = ColorReductionType.SELECTIVE;

   sfwOptions.dither = Dither.NONE; 

   sfwOptions.ditherAmount = 80;

   sfwOptions.webSnap = 0;

   sfwOptions.colors = 128;

activeDocument.exportDocument(saveFile, ExportType.SAVEFORWEB, sfwOptions);

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 21, 2017 Jul 21, 2017

Use it before using save for web set forever in in the frame animation timeline. Or make it the first part of your save for web function

JJMack
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 21, 2017 Jul 21, 2017

Sorry! I just did not notice the whole 2-nd string (!!!) from your previous message! Sorry!

So, I've made forever.jsx and run it on my animation in Photoshop and get error 8800 The command "Set" is not currently available. Line: 19 (executeAction( idsetd, desc19, DialogModes.NO );)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 21, 2017 Jul 21, 2017

That would be a valid error message if the documents does not have a frame animation timeline.  How can you set a setting that does not exists. The current active document must have a frame animation in order to set it to loop forever. Check you documents timeline is there a frame animation in it????

Capture.jpg

JJMack
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 21, 2017 Jul 21, 2017

I stuck... I have a smooth animation which consists of a bunch of layers of different kinds - smart objects, effects, etc.

2017-07-22_00-20-18.jpg

I cannot find a way to convert these layers into frame animation...

I saw a bunch of "make frame animation from layers" tutorials, but none of them seems to fit my case.

Once I am trying to rasterize smart objects - I loose all animation effects.

Please help me to find the right tutorial or tell me how I can convert this timeline animation into a frame animation. 

Would be very grateful!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 22, 2017 Jul 22, 2017

My script below saves .gif file from Photoshop, but with Looping = 1. I need Looping = forever.
There is a program, called Gifsicle  http://www.lcdf.org/gifsicle/

It runs under the command line and does everything with GIF.

In my case, Gifsicle string looks like that:

C://gifsicle.exe --batch --loop=forever −−careful *.gif

Is it possible at all for Photoshop jsx script to run Gifsicle and convert the file on disk AFTER this jsx script saves this file to the disc?

If yes, can anybody help me to integrate the line above into my "saving gif" script below?

#target photoshop

main();

function main(){

if(!documents.length) return;

try{

var Path= activeDocument.path;

}catch(e){var Path = "~/desktop";}

var Name = decodeURI(app.activeDocument.name).replace(/\.[^\.]+$/, '');

var layerName = app.activeDocument.activeLayer.name.replace(/[:\/\\*\?\"\<\>\|]/g, "_");

var saveFile= new File(Path + "/" + Name + "-" + layerName + ".gif");

SaveForWeb(saveFile);

}

function SaveForWeb(saveFile) {

var sfwOptions = new ExportOptionsSaveForWeb();

   sfwOptions.format = SaveDocumentType.COMPUSERVEGIF;

   sfwOptions.includeProfile = false;

   sfwOptions.interlaced = 1;

   sfwOptions.optimized = true;

   sfwOptions.transparency = 1;

   sfwOptions.ColorReductionType = ColorReductionType.SELECTIVE;

   sfwOptions.dither = Dither.NONE;   

   sfwOptions.ditherAmount = 80;

   sfwOptions.webSnap = 0;

   sfwOptions.colors = 128;

activeDocument.exportDocument(saveFile, ExportType.SAVEFORWEB, sfwOptions);

}

http://www.lcdf.org/gifsicle/

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 22, 2017 Jul 22, 2017

I gave you the Scriptlistener code the other day. Told you to use it  befire the save for web step.   I created a PSD document from your gif and set the frame animation to once.  Tot can see the in this screen capture.  I then selected you script the the modfication added and you can see the onec was set to forever and the gif saved with a file name of document name - bottom layer name.gif  loops.  The other amation you show is from a video timeline and the forever would need to be set in the save for web step. Of saved with once then open the gif in photoshop and run your script with the set forever in its frame animation timeline.

Capture.jpglogo-Layer-1.gif

#target photoshop

main();

function main(){

if(!documents.length) return;

try{

var Path= activeDocument.path;

}catch(e){var Path = "~/desktop";}

var Name = decodeURI(app.activeDocument.name).replace(/\.[^\.]+$/, '');

var layerName = app.activeDocument.activeLayer.name.replace(/[:\/\\*\?\"\<\>\|]/g, "_");

var saveFile= new File(Path + "/" + Name + "-" + layerName + ".gif");

SetForever();

SaveForWeb(saveFile);

}

function SaveForWeb(saveFile) {

var sfwOptions = new ExportOptionsSaveForWeb();

   sfwOptions.format = SaveDocumentType.COMPUSERVEGIF;

   sfwOptions.includeProfile = false;

   sfwOptions.interlaced = 1;

   sfwOptions.optimized = true;

   sfwOptions.transparency = 1;

   sfwOptions.ColorReductionType = ColorReductionType.SELECTIVE;

   sfwOptions.dither = Dither.NONE;  

   sfwOptions.ditherAmount = 80;

   sfwOptions.webSnap = 0;

   sfwOptions.colors = 128;

activeDocument.exportDocument(saveFile, ExportType.SAVEFORWEB, sfwOptions);

}

function SetForever() {

var idsetd = charIDToTypeID( "setd" );

    var desc19 = new ActionDescriptor();

    var idnull = charIDToTypeID( "null" );

        var ref3 = new ActionReference();

        var idanimationClass = stringIDToTypeID( "animationClass" );

        var idOrdn = charIDToTypeID( "Ordn" );

        var idTrgt = charIDToTypeID( "Trgt" );

        ref3.putEnumerated( idanimationClass, idOrdn, idTrgt );

    desc19.putReference( idnull, ref3 );

    var idT = charIDToTypeID( "T   " );

        var desc20 = new ActionDescriptor();

        var idanimationLoopEnum = stringIDToTypeID( "animationLoopEnum" );

        var idanimationLoopType = stringIDToTypeID( "animationLoopType" );

        var idanimationLoopForever = stringIDToTypeID( "animationLoopForever" );

        desc20.putEnumerated( idanimationLoopEnum, idanimationLoopType, idanimationLoopForever );

    var idanimationClass = stringIDToTypeID( "animationClass" );

    desc19.putObject( idT, idanimationClass, desc20 );

executeAction( idsetd, desc19, DialogModes.NO );

}

JJMack
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 22, 2017 Jul 22, 2017

Thank you very much for answering JJMack!

You are absolutely right and your Scriptlistener code works perfectly IF
we have FRAME animation - a
s on your example.

On my side, I have prepared TIMELINE animation with complex smart objects (one smart objects inside another), effects, etc. NOT ONLY layers with static pics.

My problem is - I cannot convert TIMELINE animation into FRAME animation!
I saw and follow many tutorials on how to convert layers into frame animation.
But none of them worked for me - once I rasterize smart objects - all my tuned animation ruins.

Obviously, I do something wrong but I cannot understand what exactly!

If you know a right tutorial or can explain to me how to convert complex timeline into frame animation - I would be VERY grateful!

Only after that, I can use your code to create looped forever gif animation.

Please see. This is how my timeline animation looks like.

Scriptlistener code

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 22, 2017 Jul 22, 2017

I tried to capture scriptlistener code where I did not set the forever in the frame animation timeline but set it in save for web Dialog.  The Gif saved looped but when I used the scriptlisener code to see if it work it saved a GIF that do not loop. 

I also did not see any anything in Adobe Photoshop Javascript DOM documentin for save for web as GIF and loop forever.  The word forever is not found in the manual. 

What I also wrote is you can open the gif you saved that does not loop in Photoshop and run your script with the set forever code and the gif saved will loop.

JJMack
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 22, 2017 Jul 22, 2017

You can convert a video timeline into a working frame animation but it can be quite involved,  If You can save your video timeline as a gif when you open that gif in Photoshop   you have your frame animation. You can set forever. and save it out. Your script could save for web gif once open the gif set forever and re-save the gif.

JJMack
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 22, 2017 Jul 22, 2017

I see... Thank you very much!

If I have to open the saved GIF in Photoshop again... don't you think it would be easier to use not Photoshop but a lightweight third party program to convert GIF that loops once to GIF that loops forever?

I found such a program called Gifsicle www.lcdf.org/gifsicle

And this string in command line "C://gifsicle.exe --batch --loop=forever −−careful *.gif " does all we need!

It should be run when saved by Photoshop GIF is already on the disc. So, AFTER the scripts work.

Could you please tell how to include this string "C://gifsicle.exe --batch --loop=forever −−careful *.gif " into that script?

That should the solution...

  1. #target photoshop 
  2. main(); 
  3. function main(){ 
  4. if(!documents.length) return
  5. try
  6. var Path= activeDocument.path; 
  7. }catch(e){var Path = "~/desktop";} 
  8. var Name = decodeURI(app.activeDocument.name).replace(/\.[^\.]+$/, ''); 
  9. var layerName = app.activeDocument.activeLayer.name.replace(/[:\/\\*\?\"\<\>\|]/g, "_"); 
  10. var saveFile= new File(Path + "/" + Name + "-" + layerName + ".gif"); 
  11. SaveForWeb(saveFile); 
  12.  
  13.  
  14. function SaveForWeb(saveFile) { 
  15. var sfwOptions = new ExportOptionsSaveForWeb(); 
  16.    sfwOptions.format = SaveDocumentType.COMPUSERVEGIF; 
  17.    sfwOptions.includeProfile = false
  18.    sfwOptions.interlaced = 1
  19.    sfwOptions.optimized = true
  20.    sfwOptions.transparency = 1
  21.    sfwOptions.ColorReductionType = ColorReductionType.SELECTIVE; 
  22.    sfwOptions.dither = Dither.NONE;    
  23.    sfwOptions.ditherAmount = 80
  24.    sfwOptions.webSnap = 0
  25.    sfwOptions.colors = 128
  26. activeDocument.exportDocument(saveFile, ExportType.SAVEFORWEB, sfwOptions); 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 23, 2017 Jul 23, 2017

I'm a bit disappointed in your faith in your ability to hack a script like I suggested.   Here is your script.  I only hack scripting. Had a problem using the bottom layer name in the save file name because it has a Blank in it and Blanks are a bit tricky in scripting they become %20 and require special handling at time. Open did not work because of that. So I change the savefile name to DocName-Animation.gif.

#target photoshop

main();

function main(){

if(!documents.length) return;

try{

var Path= activeDocument.path;

}catch(e){var Path = "~/desktop";}

var Name = decodeURI(app.activeDocument.name).replace(/\.[^\.]+$/, '');

var layerName = app.activeDocument.activeLayer.name.replace(/[:\/\\*\?\"\<\>\|]/g, "_");

//var saveFile= new File(Path + "/" + Name + "-" + layerName + ".gif");

var saveFile= new File(Path + "/" + Name + "-Animation" + ".gif");

SaveForWeb(saveFile);

open(saveFile); // Open the GIF

SetForever();           // Set Forever

SaveForWeb(saveFile);   // re-save

activeDocument.close(SaveOptions.DONOTSAVECHANGES); //close Gif

}

function SaveForWeb(saveFile) {

var sfwOptions = new ExportOptionsSaveForWeb();

   sfwOptions.format = SaveDocumentType.COMPUSERVEGIF;

   sfwOptions.includeProfile = false;

   sfwOptions.interlaced = 1;

   sfwOptions.optimized = true;

   sfwOptions.transparency = 1;

   sfwOptions.ColorReductionType = ColorReductionType.SELECTIVE;

   sfwOptions.dither = Dither.NONE;  

   sfwOptions.ditherAmount = 80;

   sfwOptions.webSnap = 0;

   sfwOptions.colors = 128;

activeDocument.exportDocument(saveFile, ExportType.SAVEFORWEB, sfwOptions);

}

function SetForever() {

var idsetd = charIDToTypeID( "setd" );

    var desc19 = new ActionDescriptor();

    var idnull = charIDToTypeID( "null" );

        var ref3 = new ActionReference();

        var idanimationClass = stringIDToTypeID( "animationClass" );

        var idOrdn = charIDToTypeID( "Ordn" );

        var idTrgt = charIDToTypeID( "Trgt" );

        ref3.putEnumerated( idanimationClass, idOrdn, idTrgt );

    desc19.putReference( idnull, ref3 );

    var idT = charIDToTypeID( "T   " );

        var desc20 = new ActionDescriptor();

        var idanimationLoopEnum = stringIDToTypeID( "animationLoopEnum" );

        var idanimationLoopType = stringIDToTypeID( "animationLoopType" );

        var idanimationLoopForever = stringIDToTypeID( "animationLoopForever" );

        desc20.putEnumerated( idanimationLoopEnum, idanimationLoopType, idanimationLoopForever );

    var idanimationClass = stringIDToTypeID( "animationClass" );

    desc19.putObject( idT, idanimationClass, desc20 );

executeAction( idsetd, desc19, DialogModes.NO );

}

JJMack
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 23, 2017 Jul 23, 2017

Please do not be disappointed!

I try really hard ... I need it VERY MUCH!

Most likely, I do something wrong. But I do not understand what exactly. Please advise!

Please look.

Here is my psd animation:

http://12-50.com/111/9-gif.psd

Here is the script file:
http://12-50.com/111/__saveloopgif.jsx

below is the result I get after the scripts works from the psd animation - as you see I get not animated gif.


Besides, the file name after layer name is a crucial part of the script - it is crucial for my workflow!

9-gif-Animation.gif

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 23, 2017 Jul 23, 2017

Something must be wrong with your setup. If it did not work on your macjine.  I downloaded your PSD and your copy of the modified script. I open your PSD in Photoshop CC 2017 and ran your script. It took Photoshop some time to save out the gifs. Here is the gif produce on my machine. If it is what you want and your machine did ntr produce it you have a problm on you machine.

9-gif-Animation.gif

JJMack
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 23, 2017 Jul 23, 2017

I just delete all settings (shift, alt, ctrl when start PS) Photoshop CC 2017.

2017-07-23_16-22-12.jpg

... and got the same result ... not animated gif...

Sorry for delayed replies. I answer as quickly as possible but each my message goes through moderation before publishing ... that is why delays.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 23, 2017 Jul 23, 2017

Did you run the script? I do not see a name like "DocName-Animation.gif" in you post  where is the gif produced if it does not loop you have a problem.

JJMack
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 23, 2017 Jul 23, 2017

2017-07-23_16-36-56.jpg

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 23, 2017 Jul 23, 2017

I think you have a problem on your machine.  Delete the GIF open the PSD in Photoshop and run the script.  It should take some time. Monitor the Desktop folder while the script is running.  You should see two .GIF being save. They will have 0 bytes for some time.  Then the temp gif should be gone and the remaining one should be around 2MB in size.

Capture.jpg

JJMack
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 23, 2017 Jul 23, 2017

First I've got 3,7Mb file then it turns to 110K ...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Jul 23, 2017 Jul 23, 2017

Does this work for you..?

#target photoshop;

try{

var Path= activeDocument.path;

}catch(e){var Path = "~/desktop";}

var Name = decodeURI(app.activeDocument.name).replace(/\.[^\.]+$/, '');

var layerName = app.activeDocument.activeLayer.name.replace(/[:\/\\*\?\"\<\>\|]/g, "_");

var saveFile= new File(Path + "/" + Name + "-" + layerName + ".gif");

saveGif(saveFile);

function saveGif(saveFile) {

var desc174 = new ActionDescriptor();

var desc175 = new ActionDescriptor();

desc175.putEnumerated( charIDToTypeID('Op  '), charIDToTypeID('SWOp'), charIDToTypeID('OpSa') );

desc175.putPath( charIDToTypeID('In  '), new File( saveFile ) );

desc175.putEnumerated( charIDToTypeID('Fmt '), charIDToTypeID('IRFm'), charIDToTypeID('GIFf') );

desc175.putBoolean( charIDToTypeID('Intr'), true );

desc175.putEnumerated( charIDToTypeID('RedA'), charIDToTypeID('IRRd'), charIDToTypeID('Sltv') );

desc175.putBoolean( charIDToTypeID('RChT'), false );

desc175.putBoolean( charIDToTypeID('RChV'), false );

desc175.putBoolean( charIDToTypeID('AuRd'), false );

desc175.putInteger( charIDToTypeID('NCol'), 128 );

desc175.putEnumerated( charIDToTypeID('Dthr'), charIDToTypeID('IRDt'), charIDToTypeID('None') );

desc175.putInteger( charIDToTypeID('DthA'), 80 );

desc175.putInteger( charIDToTypeID('DChS'), 0 );

desc175.putInteger( charIDToTypeID('DCUI'), 0 );

desc175.putBoolean( charIDToTypeID('DChT'), false );

desc175.putBoolean( charIDToTypeID('DChV'), false );

desc175.putInteger( charIDToTypeID('WebS'), 0 );

desc175.putEnumerated( charIDToTypeID('TDth'), charIDToTypeID('IRDt'), charIDToTypeID('None') );

desc175.putInteger( charIDToTypeID('TDtA'), 100 );

desc175.putInteger( charIDToTypeID('Loss'), 60 );

desc175.putInteger( charIDToTypeID('LChS'), 0 );

desc175.putInteger( charIDToTypeID('LCUI'), 100 );

desc175.putBoolean( charIDToTypeID('LChT'), false );

desc175.putBoolean( charIDToTypeID('LChV'), false );

desc175.putBoolean( charIDToTypeID('Trns'), true );

desc175.putBoolean( charIDToTypeID('Mtt '), false );

desc175.putInteger( charIDToTypeID('MttR'), 255 );

desc175.putInteger( charIDToTypeID('MttG'), 255 );

desc175.putInteger( charIDToTypeID('MttB'), 255 );

desc175.putBoolean( charIDToTypeID('SHTM'), false );

desc175.putBoolean( charIDToTypeID('SImg'), true );

desc175.putEnumerated( charIDToTypeID('SWsl'), charIDToTypeID('STsl'), charIDToTypeID('SLAl') );

desc175.putEnumerated( charIDToTypeID('SWch'), charIDToTypeID('STch'), charIDToTypeID('CHsR') );

desc175.putEnumerated( charIDToTypeID('SWmd'), charIDToTypeID('STmd'), charIDToTypeID('MDCC') );

desc175.putBoolean( charIDToTypeID('ohXH'), false );

desc175.putBoolean( charIDToTypeID('ohIC'), true );

desc175.putBoolean( charIDToTypeID('ohAA'), true );

desc175.putBoolean( charIDToTypeID('ohQA'), true );

desc175.putBoolean( charIDToTypeID('ohCA'), false );

desc175.putBoolean( charIDToTypeID('ohIZ'), true );

desc175.putEnumerated( charIDToTypeID('ohTC'), charIDToTypeID('SToc'), charIDToTypeID('OC03') );

desc175.putEnumerated( charIDToTypeID('ohAC'), charIDToTypeID('SToc'), charIDToTypeID('OC03') );

desc175.putInteger( charIDToTypeID('ohIn'), -1 );

desc175.putEnumerated( charIDToTypeID('ohLE'), charIDToTypeID('STle'), charIDToTypeID('LE03') );

desc175.putEnumerated( charIDToTypeID('ohEn'), charIDToTypeID('STen'), charIDToTypeID('EN00') );

desc175.putBoolean( charIDToTypeID('olCS'), false );

desc175.putEnumerated( charIDToTypeID('olEC'), charIDToTypeID('STst'), charIDToTypeID('ST00') );

desc175.putEnumerated( charIDToTypeID('olWH'), charIDToTypeID('STwh'), charIDToTypeID('WH01') );

desc175.putEnumerated( charIDToTypeID('olSV'), charIDToTypeID('STsp'), charIDToTypeID('SP04') );

desc175.putEnumerated( charIDToTypeID('olSH'), charIDToTypeID('STsp'), charIDToTypeID('SP04') );

var list9 = new ActionList();

var desc176 = new ActionDescriptor();

desc176.putEnumerated( charIDToTypeID('ncTp'), charIDToTypeID('STnc'), charIDToTypeID('NC00') );

list9.putObject( charIDToTypeID('SCnc'), desc176 );

var desc177 = new ActionDescriptor();

desc177.putEnumerated( charIDToTypeID('ncTp'), charIDToTypeID('STnc'), charIDToTypeID('NC19') );

list9.putObject( charIDToTypeID('SCnc'), desc177 );

var desc178 = new ActionDescriptor();

desc178.putEnumerated( charIDToTypeID('ncTp'), charIDToTypeID('STnc'), charIDToTypeID('NC28') );

list9.putObject( charIDToTypeID('SCnc'), desc178 );

var desc179 = new ActionDescriptor();

desc179.putEnumerated( charIDToTypeID('ncTp'), charIDToTypeID('STnc'), charIDToTypeID('NC24') );

list9.putObject( charIDToTypeID('SCnc'), desc179 );

var desc180 = new ActionDescriptor();

desc180.putEnumerated( charIDToTypeID('ncTp'), charIDToTypeID('STnc'), charIDToTypeID('NC24') );

list9.putObject( charIDToTypeID('SCnc'), desc180 );

var desc181 = new ActionDescriptor();

desc181.putEnumerated( charIDToTypeID('ncTp'), charIDToTypeID('STnc'), charIDToTypeID('NC24') );

list9.putObject( charIDToTypeID('SCnc'), desc181 );

desc175.putList( charIDToTypeID('olNC'), list9 );

desc175.putBoolean( charIDToTypeID('obIA'), false );

desc175.putString( charIDToTypeID('obIP'), '' );

desc175.putEnumerated( charIDToTypeID('obCS'), charIDToTypeID('STcs'), charIDToTypeID('CS01') );

var list10 = new ActionList();

var desc182 = new ActionDescriptor();

desc182.putEnumerated( charIDToTypeID('ncTp'), charIDToTypeID('STnc'), charIDToTypeID('NC01') );

list10.putObject( charIDToTypeID('SCnc'), desc182 );

var desc183 = new ActionDescriptor();

desc183.putEnumerated( charIDToTypeID('ncTp'), charIDToTypeID('STnc'), charIDToTypeID('NC20') );

list10.putObject( charIDToTypeID('SCnc'), desc183 );

var desc184 = new ActionDescriptor();

desc184.putEnumerated( charIDToTypeID('ncTp'), charIDToTypeID('STnc'), charIDToTypeID('NC02') );

list10.putObject( charIDToTypeID('SCnc'), desc184 );

var desc185 = new ActionDescriptor();

desc185.putEnumerated( charIDToTypeID('ncTp'), charIDToTypeID('STnc'), charIDToTypeID('NC19') );

list10.putObject( charIDToTypeID('SCnc'), desc185 );

var desc186 = new ActionDescriptor();

desc186.putEnumerated( charIDToTypeID('ncTp'), charIDToTypeID('STnc'), charIDToTypeID('NC06') );

list10.putObject( charIDToTypeID('SCnc'), desc186 );

var desc187 = new ActionDescriptor();

desc187.putEnumerated( charIDToTypeID('ncTp'), charIDToTypeID('STnc'), charIDToTypeID('NC24') );

list10.putObject( charIDToTypeID('SCnc'), desc187 );

var desc188 = new ActionDescriptor();

desc188.putEnumerated( charIDToTypeID('ncTp'), charIDToTypeID('STnc'), charIDToTypeID('NC24') );

list10.putObject( charIDToTypeID('SCnc'), desc188 );

var desc189 = new ActionDescriptor();

desc189.putEnumerated( charIDToTypeID('ncTp'), charIDToTypeID('STnc'), charIDToTypeID('NC24') );

list10.putObject( charIDToTypeID('SCnc'), desc189 );

var desc190 = new ActionDescriptor();

desc190.putEnumerated( charIDToTypeID('ncTp'), charIDToTypeID('STnc'), charIDToTypeID('NC22') );

list10.putObject( charIDToTypeID('SCnc'), desc190 );

desc175.putList( charIDToTypeID('ovNC'), list10 );

desc175.putBoolean( charIDToTypeID('ovCM'), false );

desc175.putBoolean( charIDToTypeID('ovCW'), true );

desc175.putBoolean( charIDToTypeID('ovCU'), true );

desc175.putBoolean( charIDToTypeID('ovSF'), true );

desc175.putBoolean( charIDToTypeID('ovCB'), true );

desc175.putString( charIDToTypeID('ovSN'), 'images' );

desc174.putObject( charIDToTypeID('Usng'), stringIDToTypeID('SaveForWeb'), desc175 );

executeAction( charIDToTypeID('Expr'), desc174, DialogModes.NO );

};

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 23, 2017 Jul 23, 2017

Yes. This script works but it loops only once. This is exactly the issue. I have the script that loops once - I need to make it loop forever.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 23, 2017 Jul 23, 2017

Did you monitor the desk top foder while the scriopr ran. Keep refreshing the windows explots with the newest files sorted to the top.  You shoyld see two gig files neinf created thet will hve 0 bytes for some time. ine the ent you should hab one 2MB size Gif the loops.  If the does not work on you machine you have a problem on your machine.  You bottom layer doe not hane a blank in it name soe I restored your file naminstatement anf ran the script you posted back a the statemant changed.  Here is whit  I see nonitoring the desktop and the gif

Capture.jpg9-gif-114.gif

JJMack
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 23, 2017 Jul 23, 2017

please send me your jsx file

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines