Variable setting "Frame Delay" for the animation.

I try to set time frame in an animation, I train. There are a lot of pictures and they all have different delays. I don't know if the script is the best way, but here's what I have so far (by using VBA because that's what I know): I'm the slightest error at line 23, saying it is a "type mismatch".

Sub Set_Frame_Delay()
    Dim appPS As Photoshop.Application
    Dim docPS As Photoshop.Document
    Dim NewLay  As Photoshop.ArtLayer
    Dim LaySet As Photoshop.LayerSet
    Dim ref1 As Photoshop.ActionReference
    Dim actPS
    
    
    Set appPS = CreateObject("Photoshop.Application")
    appPS.Visible = True
    
    Set docPS = appPS.ActiveDocument
    Set LaySet = docPS.LayerSets("Text")
    Set ref1 = CreateObject("Photoshop.ActionReference")
    
    
    For Each NewLay In LaySet.ArtLayers
            Select Case NewLay.Name
        
            Case "Test1"
        
                actPS = ref1.PutName("Frame Delay", 0.540769)
                NewLay.Application.ExecuteAction (actPS)
        
            Case "Test2"

                actPS = ref1.PutName("Frame Delay", 1.013942)
               NewLay.Application.ExecuteAction (actPS)
          End Select
      Next NewLay
    
    MsgBox "frame set"
    
 
 
End Sub


Yes, Ive used the script before listener, but hoped to avoid because I didn't understand what it spits out. But I think that I fell and I came up with below. I tweeked my original solution to use a text file.

Sub Set_Frame_Delay3()
    Dim appPS As Photoshop.Application
    Dim ActDescPS1 As Photoshop.ActionDescriptor, ActDescPS2 As Photoshop.ActionDescriptor, ActDescPS3 As Photoshop.ActionDescriptor
    Dim ActRefPS1 As Photoshop.ActionReference, ActRefPS2 As Photoshop.ActionReference
    Dim dialogMode
    Dim idsetd, idnull, idOrdn, idTrgt, idT, idslct
    Dim idAniFrClass, idAniFrDelay
    Dim sFileName As String

    Application.ScreenUpdating = False

    Set appPS = New Photoshop.Application
    appPS.Visible = True

    dialogMode = 3

    With appPS
        idsetd = .CharIDToTypeID("setd")
        idnull = .CharIDToTypeID("null")
        idOrdn = .CharIDToTypeID("Ordn")
        idTrgt = .CharIDToTypeID("Trgt")
        idT = .CharIDToTypeID("T   ")
        idslct = .CharIDToTypeID("slct")
        idAniFrClass = .StringIDToTypeID("animationFrameClass")
        idAniFrDelay = .StringIDToTypeID("animationFrameDelay")
    End With

    sFileName = Application.GetOpenFilename("Textfiles (*.txt),*.txt", , "Open a textfile...")
    oIndex = 0

    iFileNum = FreeFile()
    Open sFileName For Input As iFileNum
    Do While Not EOF(iFileNum)
        oIndex = oIndex + 1

        Line Input #iFileNum, oDelay

        Set ActDescPS1 = New Photoshop.ActionDescriptor
        Set ActRefPS1 = New Photoshop.ActionReference

        ActRefPS1.PutIndex idAniFrClass, oIndex
        ActDescPS1.PutReference idnull, ActRefPS1
        appPS.ExecuteAction idslct, ActDescPS1, dialogMode

        Set ActDescPS2 = New Photoshop.ActionDescriptor
        Set ActRefPS2 = New Photoshop.ActionReference

        ActRefPS2.PutEnumerated idAniFrClass, idOrdn, idTrgt
        ActDescPS2.PutReference idnull, ActRefPS2

        Set ActDescPS3 = New Photoshop.ActionDescriptor

        ActDescPS3.PutDouble idAniFrDelay, oDelay
        ActDescPS2.PutObject idT, idAniFrClass, ActDescPS3
        appPS.ExecuteAction idsetd, ActDescPS2, dialogMode

        Set ActDescPS1 = Nothing
        Set ActRefPS1 = Nothing
        Set ActDescPS2 = Nothing
        Set ActRefPS2 = Nothing
        Set ActDescPS3 = Nothing

    Loop
    Application.ScreenUpdating = True
    Set appPS = Nothing
    MsgBox "Frames Delays have been set!"
End Sub

The text file must list the hours in seconds in order frames. In case anyone else wants to copy the code. Such as:

0.916303

0.826175

0.660941

1.374455

Tags: Photoshop

Similar Questions

  • How to set different color for the table column header

    Can I set different colors for the 4 following as being attached.

    -color of the header text

    -the head of the column of the background color

    -color of the text of the content

    -color of background content

    The value of the cluster - 2, -2 to define all of the cells,

    Then go back and the cluster the value-1, -2 to simply set the line header.

    (If you also had a column of row headers, then -2,-1 would set them.  Course the upper left corner which is the intersection of the column header and row header will change with any of them.)

  • I have windows 8 in my computer toshiba laptop. After you set up windows for the updates it says «restoration of the changes...» Impossible to install the important updates'... What do I do?

    I have windows 8 in my computer toshiba laptop. After you set up windows for the updates it says «restoration of the changes...» Impossible to install the important updates'... What do I do?

    Hello

    Please, try the suggestions mentioned here and see if they help you:

    http://www.thewindowsclub.com/failure-configuring-Windows-updates

    Hope this helps, good luck :)

  • I need images for the animation of the interactive book for words from A to Z.

    Hello

    I'm creating interactive children's book so I need images for the animation of anyone have idea where I can take the pictures than words from A to Z or any suggestion?

    Best thing to do is to simply do a search for 'Illustrations of Stock', like Google

    All the best.

  • Our company buy Illustrator 2014 cc, this is the English version, could set us up for the traditional Chinese version?

    Our company buy Illustrator 2014 cc, this is the English version, could set us up for the traditional Chinese version?

    Hi Anna,.

    Please try the steps as described in change the language setting of your Cloud Creative applications

    Hope that helps!

    Kind regards

    Sheena

  • set "serveroutput on ' for the current session.

    I'm still new to PL/SQL and I use ' * SET SERVEROUTPUT ON SIZE 100000 "* always before I run a PL program block for dbms_output.". " I really need to know why we need to specify a size of this line & what that size will be applied to. Also, I need to know it was possible to set serveroutput enabled for the current session, rather than execute this line of code before each block of PL.

    I tried * "ALTER SESSION SET SERVEROUTPUT SIZE 1000000" *; " But it was not run successfully.

    Thank you!

    If you use SQL Developer, you do not have to issue SET serveroutput.

    in the result grid, you will have a tab called DBMS output, since the first icon will be output enable DBMS. Click once to activate it and and run your code. you will get the result in the same pane.

    Kind regards
    Prazy

  • Set a value for the range selector

    Hello

    I'm trying to set a value for a range by script selector but without success.

    Here is my line of code:

    -app.project.item (1).layer("Text1").property ("ADBE Text properties") .property ("ADBE Text Animator").property("ADBE_Text_Selector").property ("ADBE Text Index End") .setValue (3);

    the error I get is "Undefiened is not an object.

    Maybe the property method does not work for the range selector.

    I am rookie in script... that could explain the issue

    Thank you

    Aurélien

    Looks like you're missing a few steps. A host of text is included in the Group of text animations. A range selector is in the Group of selectors of text. Each of them can be referenced by name or index (you can have several animators and selectors).

    App.Project.Item (1).layer("Text1").property ("ADBE Text properties") ("ADBE Text animators") .property .property (1).property("ADBE_Text_Selectors").property (1) .property ("ADBE Text Index End") .setValue (3);

    I recommend you google and download the script "GimmePropPaths" from Jeff Almasol. Invaluable for this kid to reference.

    Paul

  • For the Animation play button

    I have an animation of 2 very simple state. The first State has no picture the last State for all images. I have a single button that appears at the end of the two State. I have the set button to return to the State when you click on it.

    Here's what I need to do - I need to have again (refresh) when the play button is simple click at the end state 2. Is this possible? For now, it's just lies to Virgin State 1.

    Thanks for any help.

    Here's a quick example. The buttons are outside the animation, but I don't think that this should be a problem. It was done in Flash Catalyst 5.5.

    The key is to look at a sequence of actions since the trigger button is clicked. What I did say first of all the component of the animation to goto State 1 (I have add a quick transition from State 2-> State 1). I then added another sequence that triggers the change of State to State 2.

    Chris

  • How to set a password for the router in mn 700?

    I have a MN-700 router and want to set a password so that other people can not access my connection. Can u please provide an astep step-by-step, instructions how to do it. Thank you.

    This is not a forum for the MN-700 router. You have to go to the manufacturer's Web site and look for the instructions or ask their support desk.

  • How to set parental controls for the zone

    Im trying to set up parental controls for children. I have set up for the clock, but they got smart and started to change the time zone. Does anyone know how to set up parental controls for the time zone... At least the name of the program for the time zone. Any help is appreciated, thanks.

    Im trying to set up parental controls for children. I have set up for the clock, but they got smart and started to change the time zone. Does anyone know how to set up parental controls for the time zone... At least the name of the program for the time zone. Any help is appreciated, thanks.

    If you have a superior taste of Windows 7 you can / must define the rights to change the time system and time zone via the policy editor gpedit.msc. They are defined in the strategy/Security Settings user rights assignments / Local. Ensure that only administrators and the Local Service can change these settings.

    If you have a taste less then you need to do it via a number of commands in the console, i.e.
    net localgroup
    NTRights users - r seSystemtimePrivilege-u
    NTRights u users - r seTimezonePrivilege

    You can download ntrights.exe here: http://www.microsoft.com/download/en/details.aspx?id=17657. If you choose this option, you may need to then more detailed instructions. Post again if this is the case.

    Note also that your children are more intelligent, they will find additional methods to bypass your restrictions. If you let me sit in front of your machine then I would be able to do as I please in less than five minutes, without knowing a single password. This means that you may need to solve this problem by teaching ways rather than technical.

  • How to set a password for the networks?

    Original title: related networks

    Hi, my request is how to set a password for networks

    Hello Manu,

    I suggest to follow the steps below and check the steps in the section to change the homegroup password , if it helps.

    Homegroup from start to finish

    http://Windows.Microsoft.com/en-us/Windows/HomeGroup-help#HomeGroup-start-to-finish=Windows-81&V1H=win81tab7&V2H=win7tab1

    Let us know the status.

  • Really bad performance for the animation of the HTML5?

    Someone find the animation HTML5 Canvas produced by Animer CC really poor compared to the animation of DOM HTML produced by Edge animate? I'm really jumpy slow animation.

    Surely, canvas animation should work better than DOM?

    Surely Adobe would not get rid of edge animate if it generates more smooth animations and then animate CC?

    You can also use the Robert Penner easing createjs use on the timeline

    Tween.js / graphics

    GSAP or

    For example

    / * The object specified by using interpolations of relieve bounce effect.

    */

    var target = this.myMC;

    var Tween is createjs. Tween.get (target, {loop: false})

    .to ({x: 255}, 1500, createjs.) Ease.bounceOut)

    Wait (1000)

    .to ({scaleX: 0.6, scaleY: 0.6, y: 60, x: 273}, 1500, createjs.) Ease.elasticInOut)

  • How to compensate for the animation of text varoius items

    Hello!

    I have text elements that are basically moving and scaling of the same amount on

    the screen, but after I duplicate I want to be able to offset the animation

    the new text so it starts on a different area of the screen.

    For example, let's say the original text text start at 960, 540

    Middle screen on a canvas of 1920 x 1080.

    text a moves 100 left and down 100 and scales up to 125%

    then duplicate this text, but I want a keyboard shortcut that will

    keep this animation but allows me to move the new text to another area.

    say the lower third.

    Is this possible?

    Nevermind, I just adjust the anchor point.

  • How can I create a new master page with a different set of pages for the menu bar?

    I want to create a new Master Page that could be used for a different set of pages with a different menu pointing to other pages...

    For example:

    Master A to include a menu for pages:

    Page 1, Page 2, Page 3,

    Master B to the guests for the pages menu:

    Page 1, Page 4, Page 5...

    Maybe I would also do Master C and D with a bar of menus different total...

    But how can I isolate the menu bar from the rest of the pages that I don't want it?

    Right click on this page that you want to isolate > menu goto option > exclude from the menu.

    Hope It could help.

  • Piece of code does not play for the animation CLICK

    myHomeButton.addEventListener (MouseEvent.MOUSE_OVER, MouseOverHome);

    myHomeButton.addEventListener (MouseEvent.MOUSE_OUT, MouseLeavesHome);

    function MouseOverHome (MouseEvent): void {}

    stopPlayReverse();

    homeHOMEanim.play ();

    }

    function MouseLeavesHome (MouseEvent): void {}

    this.addEventListener (Event.ENTER_FRAME, playReverse, false, 0, true);

    }

    function playReverse (Event): void {}

    If (homeHOMEanim.currentFrame == 1) {}

    stopPlayReverse();

    } else {}

    homeHOMEanim.prevFrame ();

    }

    }

    function stopPlayReverse(): void {}

    If (this.hasEventListener (Event.ENTER_FRAME)) {}

    this.removeEventListener (Event.ENTER_FRAME, playReverse);

    }

    }

    myHomeButton.addEventListener (MouseEvent.CLICK, ClickHome);

    function ClickHome(event: MouseEvent): void {}

    If (homeHOMEanim.currentFrame > = 0, homeHOMEanim.currentframe < = 4) {}

    homeHOMEanim.gotoAndPlay (36) ;}

    If (homeHOMEanim.currentFrame > = 4, homeHOMEanim.currentframe < = 8) {}

    homeHOMEanim.gotoAndPlay (39) ;}

    If (homeHOMEanim.currentFrame > = 7, homeHOMEanim.currentframe < = 12) {}

    homeHOMEanim.gotoAndPlay (41) ;}

    If (homeHOMEanim.currentFrame > = 11, homeHOMEanim.currentframe < = 16) {}

    homeHOMEanim.gotoAndPlay (42) ;}

    }

    In this code, the upper part works perfectly (in other words, everything that precedes the method addEventListener (MouseEvent.CLICK, ClickHome);), it is so that when the mouse passes over the home button, the animation starts. When the mouse leaves the button, the animation runs in reverse back to the start.

    However, none of the last part of the code seems to work.

    Thank you

    myHomeButton.addEventListener (MouseEvent.CLICK, ClickHome);

    function ClickHome(event: MouseEvent): void {}

    If (homeHOMEanim.currentFrame == 1 | homeHOMEanim.currentFrame == 2 | homeHOMEanim.currentFrame == 3) {}

    homeHOMEanim.gotoAndPlay (36);

    }

    If (homeHOMEanim.currentFrame == 4 | homeHOMEanim.currentFrame == 5 | homeHOMEanim.currentFrame == 6: homeHOMEanim.currentFrame == 7) {}

    homeHOMEanim.gotoAndPlay (39);

    }

    If (homeHOMEanim.currentFrame == 8 | homeHOMEanim.currentFrame == 9 | homeHOMEanim.currentFrame = 10 | homeHOMEanim.currentFrame == 11) {}

    homeHOMEanim.gotoAndPlay (41);

    }

    If (homeHOMEanim.currentFrame == 12 | homeHOMEanim.currentFrame == 13 | homeHOMEanim.currentFrame = 14 | homeHOMEanim.currentFrame == 15) {}

    homeHOMEanim.gotoAndPlay (42);

    }

    }

    For some reason-it worked, but others with the ' &' don't.

Maybe you are looking for

  • Export chart xy to PowerPoint?

    Hi all My LabVIEW VI data using Graph XY plots. The VI made several graphs. Is it possible to program the VI to open a space empty (or existing) Power Point presentation and place each of these graphs XY in different pages of the Power Point?

  • updated to windows live mail.

    updated to windows live mail. Look a lot different. Always have the problem of sending well. Shows, sent, but does not go to the desired mailbox? Can send messages on the isp server. correct parameters. It must be something in live mail? Puzzled?

  • USB Microphone setting

    Suppose I have a USB microphone, with technical specifications, 16-bit, 48 kHz. Now, when I change the setting in the Audio hardware preferences, selecting anything other than 48K of the questions? Futher when you save an audio file, can I save it to

  • Write a CLOB on a file

    HelloI need to create a package that should generate output in an XML file.Between the different file tag, there is a ImageData, which must contain a Base64 attachment. The attachment is stored in a CLOB, and thanks to the ENCODEBLOB function (below

  • Auto generate indexes for CF

    Where as "auto generate FK index" option in DataModeler 4.0.3?