THANK YOUUU
This is exacly what i needed.
I am extremely grateful for this
Thanx
THANK YOUUU
This is exacly what i needed.
I am extremely grateful for this
Thanx
Does anyone know if there is any documentation on scripting for video in Photoshop. In particular, I just want information for the DOM relating to video. From what I can tell, the Adobe documentation doesn't cover anything related to video. It seems like a "black box".
I don't know about official documentation.
With action manager code you can get these informations:
In smartObjectMore is some info about frames and duration ect.
With script listener you probably could record some commands related to video.
{ "name": "Štěpán%20Bechynský-SD", "color": "none", "visible": true, "mode": "normal", "opacity": 255, "layerID": 28, "itemIndex": 27, "count": 27, "preserveTransparency": false, "layerFXVisible": false, "globalAngle": 90, "background": false, "layerSection": "layerSectionContent", "layerLocking": { "protectTransparency": false, "protectComposite": false, "protectPosition": false, "protectArtboardAutonest": false, "protectAll": false }, "group": false, "targetChannels": [ { "count": 5, "typename": "ActionDescriptor" }, { "count": 5, "typename": "ActionDescriptor" }, { "count": 5, "typename": "ActionDescriptor" } ], "visibleChannels": [ { "count": 5, "typename": "ActionDescriptor" }, { "count": 5, "typename": "ActionDescriptor" }, { "count": 5, "typename": "ActionDescriptor" } ], "channelRestrictions": [ "red", "grain", "blue" ], "fillOpacity": 255, "hasUserMask": false, "hasVectorMask": false, "proportionalScaling": false, "layerKind": 5, "hasFilterMask": false, "userMaskDensity": 255, "userMaskFeather": 0, "vectorMaskDensity": 255, "vectorMaskFeather": 0, "bounds": { "top": 220, "left": 214, "bottom": 580, "right": 854, "width": 640, "height": 360 }, "boundsNoEffects": { "top": 220, "left": 214, "bottom": 580, "right": 854, "width": 640, "height": 360 }, "boundsNoMask": { "top": 220, "left": 214, "bottom": 580, "right": 854, "width": 640, "height": 360 }, "smartObject": { "placed": "rasterizeContent", "documentID": "", "compsList": { "compID": -1, "originalCompID": -1 }, "linked": false, "fileReference": "Štěpán%20Bechynský-SD.psb" }, "useAlignedRendering": false, "generatorSettings": { }, "keyOriginType": [ ], "fillEnabled": false, "animationProtection": { "animationUnifyPosition": false, "animationUnifyEffects": false, "animationUnifyVisibility": false, "animationPropagate": true }, "artboard": { "artboardRect": { "top": 0, "left": 0, "bottom": 0, "right": 0 }, "guideIDs": [ ], "artboardPresetName": "", "color": { "red": 255, "grain": 255, "blue": 255 }, "artboardBackgroundType": 1 }, "artboardEnabled": false, "vectorMaskEnabled": false, "vectorMaskEmpty": true, "textWarningLevel": 0, "smartObjectMore": { "ID": "f4445b3c-11a8-11e7-ae40-d173f257a8cd", "placed": "f4445b3b-11a8-11e7-ae40-d173f257a8cd", "pageNumber": 1, "totalPages": 1, "crop": 1, "frameStep": { "numerator": 24, "denominator": 600 }, "duration": { "numerator": 1346496, "denominator": 600 }, "frameCount": 2, "antiAliasType": 16, "type": 2, "transform": [ 214, 220, 854, 220, 854, 580, 214, 580 ], "nonAffineTransform": [ 214, 220, 854, 220, 854, 580, 214, 580 ], "warp": { "warpStyle": "warpNone", "warpValue": 0, "warpPerspective": 0, "warpPerspectiveOther": 0, "warpRotate": "horizontal", "bounds": { "top": 0, "left": 0, "bottom": 360, "right": 640 }, "uOrder": 4, "vOrder": 4 }, "size": { "width": 640, "height": 360 }, "resolution": 72, "comp": -1, "compInfo": { "compID": -1, "originalCompID": -1 } } } //////////////
I don't think there is any info on using the DOM for video editing, and I doubt that you can. AM code runs faster, so you most likely will be limited to what you can get from scriptlistener - if anything.
I found another unreadable solution. Kind of like yours.
Nightmare.
The only people that could read this are finding Shia's flag.
There should be a PurgePantone()
Thanks for the effort.
That is kind of what I thought. I wonder if there is even anything created in the DOM for video. I think I already figured out how to do what I am trying to do using script listener. I basically just want to loop through each frame and then run an action on each frame. I just thought it would be nice if there was stuff that could be done using the DOM.
There haven't been any major improvements to the DOM for years, well before video was added to PS, and as I mentioned earlier, AM code runs faster.
I do use script listener/AM for a lot of things. I was just looking for an easy way to get the current minute, second, frame count for whatever frame it is on. I figured if it was in the DOM then I could just easily retrieve the data without have to create cryptic action descriptors (which I am not very good at). I basically just want to be able to specify a start and stop point to process a section of the video. Anyway, I'll post if I can figure out how to read the current minutes / seconds / frame using AM code. I'm pretty sure it can be done.
How did you get that data from action manager?
Good question. I'm not good at modifying AM code. I asked Jeff Tranberry about a project I wanted to do with video, and he just replied that it's "Dark magic." Davide Barrenca is in the process of writing a book on extendscript and including how to work with AM code. He gave me a sneak peek, and it looks like it will be a great resource.
I used it for properties JSON above. (only for reading) This will do all black magic instead you. You only need to get action descriptor.
Timeline position is not stored in layer. It could be in document descriptor.
I'll be looking forward to seeing the AM code documentation that Davide comes up with.
Thanks, I'll look into the Github doc you posted.
Does this help?
// 2017, use it at your own risk;
#target photoshop
var theGradient = gradientLayer([[0,0,0,0], [1000,128,128,255], [2000,255,255,0]]);
function gradientLayer(theArray) {
// =======================================================
var idClr = charIDToTypeID( "Clr " );
var idRd = charIDToTypeID( "Rd " );
var idGrn = charIDToTypeID( "Grn " );
var idBl = charIDToTypeID( "Bl " );
var idRGBC = charIDToTypeID( "RGBC" );
var idLctn = charIDToTypeID( "Lctn" );
var idMdpn = charIDToTypeID( "Mdpn" );
var idOpct = charIDToTypeID( "Opct" );
var idPrc = charIDToTypeID( "#Prc" );
var idTrnS = charIDToTypeID( "TrnS" );
var idType = charIDToTypeID( "Type" );
var idMk = charIDToTypeID( "Mk " );
var desc10 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref1 = new ActionReference();
ref1.putClass( idcontentLayer = stringIDToTypeID( "contentLayer" ) );
desc10.putReference( idnull, ref1 );
var idUsng = charIDToTypeID( "Usng" );
var desc11 = new ActionDescriptor();
var idType = charIDToTypeID( "Type" );
var desc12 = new ActionDescriptor();
desc12.putBoolean( charIDToTypeID( "Dthr" ), true );
desc12.putUnitDouble( charIDToTypeID( "Angl" ), charIDToTypeID( "#Ang" ), 0.000000 );
desc12.putEnumerated( idType, charIDToTypeID( "GrdT" ), charIDToTypeID( "Lnr " ) );
var idGrad = charIDToTypeID( "Grad" );
var desc13 = new ActionDescriptor();
var idNm = charIDToTypeID( "Nm " );
desc13.putString( idNm, "Custom" );
var idGrdF = charIDToTypeID( "GrdF" );
desc13.putEnumerated( idGrdF, idGrdF, charIDToTypeID( "CstS" ) );
var idIntr = charIDToTypeID( "Intr" );
desc13.putDouble( idIntr, 4096.000000 );
var list1 = new ActionList();
// insert color stops;
for (var m = 0; m < theArray.length; m++) {
var desc14 = new ActionDescriptor();
var desc15 = new ActionDescriptor();
desc15.putDouble( idRd, theArray[m][1] );
desc15.putDouble( idGrn, theArray[m][2] );
desc15.putDouble( idBl, theArray[m][3] );
desc14.putObject( idClr, idRGBC, desc15 );
var idClry = charIDToTypeID( "Clry" );
var idUsrS = charIDToTypeID( "UsrS" );
desc14.putEnumerated( idType, idClry, idUsrS );
desc14.putInteger( idLctn, theArray[m][0] );
desc14.putInteger( idMdpn, 50 );
var idClrt = charIDToTypeID( "Clrt" );
list1.putObject( idClrt, desc14 );
};
desc13.putList( charIDToTypeID( "Clrs" ), list1 );
var idTrns = charIDToTypeID( "Trns" );
var list2 = new ActionList();
var desc18 = new ActionDescriptor();
desc18.putUnitDouble( idOpct, idPrc, 100.000000 );
desc18.putInteger( idLctn, 0 );
desc18.putInteger( idMdpn, 50 );
list2.putObject( idTrnS, desc18 );
var desc19 = new ActionDescriptor();
desc19.putUnitDouble( idOpct, idPrc, 100.000000 );
desc19.putInteger( idLctn, 100 );
desc19.putInteger( idMdpn, 50 );
list2.putObject( idTrnS, desc19 );
desc13.putList( idTrns, list2 );
var idGrdn = charIDToTypeID( "Grdn" );
desc12.putObject( idGrad, idGrdn, desc13 );
desc11.putObject( idType, stringIDToTypeID( "gradientLayer" ), desc12 );
desc10.putObject( idUsng, stringIDToTypeID( "contentLayer" ), desc11 );
executeAction( idMk, desc10, DialogModes.NO );
return activeDocument.activeLayer
};
I created a script to loop through all video frames and run actions. I want to have a way to abort it if needed. The esc key is not working so well for this. Every now and then I can get it to trigger. However, I think the jsx is just constantly busy doing stuff that is doesn't allow the esc key to trigger the script aborting.
Does anyone know of a work around for this? I tried a palette Window (not officially supported, I know) with a button but the user can't get control of the window while the script is processing. I also tried adding an app level and doc level keydown event listener. However, I don't think the keydown event listener is supported at an app or doc level.
Am I just out of luck on this?
Hi,
I have an action that I've created in photoshop. I'd like to automate the process of running this action. I've done this in the past in C# using the Photoshop driver. I've abandoned C# for Node.js and would like to learn how to do this in Node.js.
Any help would be greatly appreciated!
Not sure about node.js – however with regular javascript/extendscript the line of code would be:
app.doAction("My Action","My Action Set.atn")
Hope this helps!
Well.... oops. I had my the contents in my loop in a try/catch which was catching the ESC command. I had the try/catch in place so if the selected video clip layer did not span the entire timeline then it would catch the error and just go to the next frame. Once I removed the try/catch the ESC works fine.
Hi,
Fist convert your action to .jsx.
If You are using standalone Node or PS's built in one, use generator to send JSXs to Photoshop: generator-core
Check out the
Generator.prototype.evaluateJSXString = function (s)
If You are in a HTML panel and node is enabled with
<Parameter>--enable-nodejs</Parameter><Parameter>--mixed-context</Parameter>
You can simply used CSInterface-x.y.0.js 's
CSInterface.prototype.evalScript = function(script, callback)
Hi
I have had a script written for me to save several variations of a file back to our crm system. The save works ok but leaves a saving progress bar on screen which stays on screen despite the files correctly saving to their intended destinations. This doesnt stop you from working but is annoying as it will not go away unless you close photoshop and reopen it.
Can anybody offer any advise on this.