Damon D Bell
Engaged
Damon D Bell
Engaged
Activity
‎Apr 02, 2018
05:40 AM
1 Upvote
THANKS!!!!!
... View more
‎Apr 01, 2018
04:13 PM
Is there any way to get the transform rotation angle for a text layer?
... View more
‎Jan 28, 2018
06:17 AM
Thanks for the response. However, I don't think this will work with CC 2018. I emailed Davide Barranca about this and he tested it as well. He confirmed the the action descriptor returned by Select and Mask is empty. For your code on my computer running CC 2018 (Windows), it runs the Select and Mask automatically instead of Refine Edge. However, it locks up at arr.splice. I'm assuming this is because the action descriptor being return in CC 2018 is empty. Another interesting thing in CC 2018 is that when trying to run either Refine Mask or Refine Edge through scripts it will run Select and Mask instead. In CC 2018, you can still use the legacy Refine Mask through the top menu item if you shift+click on Select and Mask. That will bring up the legacy Refine Mask UI and use the Refine Mask algorithms instead of Select and Mask. I've been wanting to run that through scripts too. However, using script listener code recorded in older Photoshop version to run Refine Mask will still launch Select and Mask in CC 2017/2018. So for scripting in CC, it looks like you can only use Select and Mask and not the legacy Refine Mask.
... View more
‎Jan 03, 2018
09:29 PM
window.location in CC 2018 on my iMac with a 5k retina display reports coordinates that make no sense at all. In Windows it works fine. I created a simple test window with a button to alert coordinates. The coordinates make zero sense based on the window location. See the screenshots. Is there another way to get the coordinates? testWin = new Window('dialog'); testWin.margins = 15; btn = testWin.add('button'); btn.text = 'Where Am I?'; btn.onClick=function(){alert(testWin.location);} testWin.show();
... View more
‎Oct 26, 2017
12:24 PM
Thanks for the reply. I know the regular paste in the center is not a bug which was why I was trying to use paste in place. I was just noting that it worked as it should for troubleshooting purposes. Anyway, for future reference, is there somewhere else that I am suppose to report a bug? I searched but it seemed this forum is where it pointed me. If there is an actual bug report form to fill out or something then could you point the address to me for future reference? Thanks again.
... View more
‎Oct 24, 2017
09:56 AM
1 Upvote
With the new CC 2018 layer based copy feature, "paste in place" does not paste anything from an action. The action will record an action step for the "paste in place" but the action step does not actually paste anything. Paste in Place does work correctly when doing in manually from the new layer copy feature. Also, paste in place works from an action if it is a selection copy, just not the new layer copy. Also, the regular paste command works in an action from the new layer copy feature (but will center based on transparency bounds).
... View more
‎Oct 23, 2017
11:26 AM
Thanks for the info. Also, just curious, have you seen the text sizing issue on CC at all? For me I have only seen it prior to CC. Also, on my system, I can no longer re-create the issue on CS6. I used to be able to create the issue on CS6 by transforming the text and saving the file with the transformed text. Now, when I do that, CS6 works fine just like CC. I'm not sure what fixed it on my system.
... View more
‎Oct 20, 2017
05:09 PM
Thanks for the reply! That's clever. I'd not thought of doing that. I think I could use that same concept for what I am doing. For my script I wouldn't want to duplicate and delete because the user sometimes has adjustment layers above the text layer clipped to the text and those could become unclipped. However, I think the same concept could be done without duplicating. Perhaps doing it this way for my script would work. It would still replace the text regardless if the resizing happened but it would alert the use that they needed to fix the template. 1. collect the bounds for the text layer 2. replace the text in the current layer with the same text that is already in the layer 3. collect the bounds again and compare 4. If the bounds match then replace the text with the new text 5. If the bounds don't match then alert the user to fix the template
... View more
‎Sep 28, 2017
09:49 PM
A lot of code snippets I find seem to have "new" in it. I'm trying to figure out exactly what it does. I've been googling and can't seem to really figure it out. I've tested a lot of things with and without "new" and it doesn't seem to make a difference. For example, these to lines of code both work with or without "new". So is "new" really needed and if so why? app.activeDocument.activeLayer.translate(new UnitValue(1000,'px'),new UnitValue(1000,'px')); app.activeDocument.activeLayer.translate(UnitValue(1000,'px'),UnitValue(1000,'px'));
... View more
‎Sep 22, 2017
12:18 PM
Is there a way through the DOM to specify a new document in pixel dimensions regardless of the user's ruler settings? For example, this entry will create a document that is 2400x3000 pixels if the ruler units are set to pixels. However, if the ruler unit is set to inches then it tries to make it 2400x3000 inches instead of pixels. When I searched in google the answers seem to be to change the ruler unit preferences through scripting and then change the ruler settings back after the document is created. Is there a better way without changing the ruler settings? I believe I did this in the past with the script listener and didn't need to change the ruler settings. However, I'm wondering if it is possible with the DOM. app.documents.add(2400,3000,300,"My image",NewDocumentMode.RGB);
... View more
‎Aug 30, 2017
07:06 AM
Nevermind, found in in a prior forum posting. Works perfectly for soft selections try{// catch error if no selection. var b = app.activeDocument.selection.bounds; var x = b[0].value; var y = b[1].value; var w = b[2].value-b[0].value; var h = b[3].value-b[1].value; var unit = b[0].type; alert('Selection info\rx:'+x.toFixed(1)+' '+unit+', y:'+y.toFixed(1)+' '+unit+'\rw:'+w.toFixed(1)+' '+unit+', h:'+h.toFixed(1)+' '+unit); }catch(e){}
... View more
‎Aug 30, 2017
06:58 AM
Thanks, I'll be interested to know. I'm leaning towards it being by design.
... View more
‎Aug 30, 2017
06:56 AM
Is there a way to get the "bounding box" coordinates of a non-rectangular, soft selection? Basically, I'm wanting to get the coordinates of where it would crop if you were to crop to the selection. The selections may be any shape and may have soft edges.
... View more
‎Aug 22, 2017
05:10 PM
I already thought of that. I ran a test using a given set of values with Select and Mask though the UI, Refine Mask through the UI, the Refine Mask scipt with DialogMode.NO, and the Select and Mask script with DialogMode.NO. I then compared all 4 masks. The 3 masks from the Select and Mask script, Refine Mask script and the Select and Mask through the UI all matched pixel for pixel.The Refine Mask through the UI did not match any of the others. So in my case, the script with DialogMode.NO was for sure using the Select and Mask algorithm and not the Refine Mask algorithm.
... View more
‎Aug 22, 2017
03:33 PM
Did you switch to DialogMode.ALL to verify it was using Refine Mask and Not Select and Mask? On my computer with your script, CC 2017 runs Select and Mask, not Refine Mask. When set to DialogMode.ALL, it brings up the Select and Mask UI instead of the Refine Mask UI. With DialogMode.NO, the mask results show Select and Mask was ran, not Refine Mask. Your script listener code looks the same as what I recorded like. At least on my computer, CC 2017 apperas to override the Refine Mask script and use Select and Mask instead.
... View more
‎Aug 22, 2017
01:31 PM
Here are the function recorded from script listener. I know the refine Mask wors in CS5-CC2015 on both Windows and Mac. The Select and Mask function works on both Windows and Mac for CC2015.5 and CC 2017. For CC 2017, I've only tested the refine mask function on Windows. It uses Select and Mask instead. I just recently found out that CC 2017 still had the old Refine Mask feature hidden but it works. I was hoping it could also run from script. //selectAndMask(100,10,0.5,20,-20); refineMask(100,10,0.5,20,-20); function selectAndMask(radius,smooth,feather,contrast,shift){ // ======================================================= var idsmartBrushWorkspace = stringIDToTypeID( "smartBrushWorkspace" ); var desc125 = new ActionDescriptor(); var idsmartBrushRadius = stringIDToTypeID( "smartBrushRadius" ); desc125.putInteger( idsmartBrushRadius, radius ); var idsmartBrushSmooth = stringIDToTypeID( "smartBrushSmooth" ); desc125.putInteger( idsmartBrushSmooth, smooth ); var idsmartBrushFeather = stringIDToTypeID( "smartBrushFeather" ); var idPxl = charIDToTypeID( "#Pxl" ); desc125.putUnitDouble( idsmartBrushFeather, idPxl, feather ); var idsmartBrushContrast = stringIDToTypeID( "smartBrushContrast" ); var idPrc = charIDToTypeID( "#Prc" ); desc125.putUnitDouble( idsmartBrushContrast, idPrc, contrast ); var idsmartBrushShiftEdge = stringIDToTypeID( "smartBrushShiftEdge" ); var idPrc = charIDToTypeID( "#Prc" ); desc125.putUnitDouble( idsmartBrushShiftEdge, idPrc, shift ); var idsampleAllLayers = stringIDToTypeID( "sampleAllLayers" ); desc125.putBoolean( idsampleAllLayers, false ); var idsmartBrushUseSmartRadius = stringIDToTypeID( "smartBrushUseSmartRadius" ); desc125.putBoolean( idsmartBrushUseSmartRadius, true ); var idsmartBrushDecontaminate = stringIDToTypeID( "smartBrushDecontaminate" ); desc125.putBoolean( idsmartBrushDecontaminate, false ); var idrefineEdgeOutput = stringIDToTypeID( "refineEdgeOutput" ); var idrefineEdgeOutput = stringIDToTypeID( "refineEdgeOutput" ); var idselectionOutputToUserMask = stringIDToTypeID( "selectionOutputToUserMask" ); desc125.putEnumerated( idrefineEdgeOutput, idrefineEdgeOutput, idselectionOutputToUserMask ); executeAction( idsmartBrushWorkspace, desc125, DialogModes.ALL ); } function refineMask(radius,smooth,feather,contrast,shift){ // ======================================================= var idrefineSelectionEdge = stringIDToTypeID( "refineSelectionEdge" ); var desc12 = new ActionDescriptor(); var idrefineEdgeBorderRadius = stringIDToTypeID( "refineEdgeBorderRadius" ); var idPxl = charIDToTypeID( "#Pxl" ); desc12.putUnitDouble( idrefineEdgeBorderRadius, idPxl, radius ); var idrefineEdgeBorderContrast = stringIDToTypeID( "refineEdgeBorderContrast" ); var idPrc = charIDToTypeID( "#Prc" ); desc12.putUnitDouble( idrefineEdgeBorderContrast, idPrc, contrast ); var idrefineEdgeSmooth = stringIDToTypeID( "refineEdgeSmooth" ); desc12.putInteger( idrefineEdgeSmooth, smooth ); var idrefineEdgeFeatherRadius = stringIDToTypeID( "refineEdgeFeatherRadius" ); var idPxl = charIDToTypeID( "#Pxl" ); desc12.putUnitDouble( idrefineEdgeFeatherRadius, idPxl, feather ); var idrefineEdgeChoke = stringIDToTypeID( "refineEdgeChoke" ); var idPrc = charIDToTypeID( "#Prc" ); desc12.putUnitDouble( idrefineEdgeChoke, idPrc, shift ); var idrefineEdgeAutoRadius = stringIDToTypeID( "refineEdgeAutoRadius" ); desc12.putBoolean( idrefineEdgeAutoRadius, true ); var idrefineEdgeDecontaminate = stringIDToTypeID( "refineEdgeDecontaminate" ); desc12.putBoolean( idrefineEdgeDecontaminate, false ); var idrefineEdgeOutput = stringIDToTypeID( "refineEdgeOutput" ); var idrefineEdgeOutput = stringIDToTypeID( "refineEdgeOutput" ); var idrefineEdgeOutputUserMask = stringIDToTypeID( "refineEdgeOutputUserMask" ); desc12.putEnumerated( idrefineEdgeOutput, idrefineEdgeOutput, idrefineEdgeOutputUserMask ); executeAction( idrefineSelectionEdge, desc12, DialogModes.ALL ); }
... View more
‎Aug 22, 2017
08:41 AM
Actually, Refine Mask works great in my script and I've been using it for many years. I'm not using it for interactively painting. I'm using it to apply the smart radius, shift edge, contrast, etc to already existing masks to clean up the edges automatically. Select and Mask replaced Refine Mask so my script now uses Select an Mask for CC 2015.5/2017 and uses refine Mask for CS5 - CC 2015. The Refine Mask seems to work better than Select and Mask for my script so I would just like to be able to script CC 2017 to use it. Refine Mask is still available in CC 2017 by shift clicking on Select and Mask in the Select dropdown menu. It brings up the old Refine Mask tool and works just as expected. I just can't get the Refine Mask to run from script in CC 2017. When the script tries to run refine Mask, CC 2017 overrides it and runs the new Select an Mask tool instead.
... View more
‎Aug 20, 2017
04:08 PM
Does anyone know if the Refine Mask tool can be ran via a script in CC 2017? Refine Mask can still be accessed in CC 2017 from the top menu by using shift + click on the Select and Mask tool under the Selection dropdown. The refine mask will record also in the script listener in CC 2017. The script listener code matches when it is recorded from CC 2015. However, when that script listener code is ran, Photoshop defaults to the Select and Mask and won't run Refine Mask. There are still a lot if issues with Select and Mask. Select and Mask doesn't give the same results on different computers using the same image and same settings. It also tends to over-erase things. I think the differences between computers may be graphics card driven but I'm not sure. When using Refine Mask in the script in CC 2015 and earlier it is much more repeatable and reliable with no differences between computers. Using the shift+click method to launch Refine Mask in CC 2017 yields the same results as using Refine Mask in CC 2015. If I could just get Refine Mask to run from the script then my life would be a whole lot better. My gut feeling is it isn't possible but I just have to ask just in case.
... View more
‎Apr 13, 2017
09:47 AM
Test out the solid color layer script I posted on an existing solid color layer. That script will open the color picker dialog allowing the user to change the RGB values. It will then return the new values the user inputs into the new descriptor. The user entered values can be stored in variables. I have been using this method for solid color and levels for a few years in one of my scripts and it works great. .....just can't get it to work with Select and Mask. For the new returned descriptor, it should be formatted just like the original descriptor from the function. The only difference it that it contains the modified values that the user changes which is what gets returned. I just don't quite grasp how to pull the info out of the descriptor. I've figured it out for the color picker and levels in the past based on old forum postings from Mike Hale. However, the Select and Mask descriptor is formatted differently and I just don't understand descriptors well enough to work the magic.
... View more
‎Apr 13, 2017
06:25 AM
Here is a working example of something similar. This is for an existing solid color layer. It brings up the dialog for the user to change the color. It then stores the RGB values into variables. I'm wanting to do the exact same thing with Select and Mask for the Smart Radius, Contrast, Shift Edge, Smoothing, and feather values. It doesn't need to record anything else from the users input. I just want the user to be able to store different preset values for staring points and they can manually brush area per image if needed (which is not needed most of the time for my script). The solid color action descriptor is much different than the select and mask action descriptor. With select and mask, it looks like all of the values are contain in a "flat" format directly under the descriptor. With the solid color action descriptor, it is more "nested". The color values are put into an object and then into a descriptor. In the following code, the descriptor is returned containing the user input values. It then gets the RGB values from the object within the descriptor. With the Select and mask Descriptor, it looks like everything is just stuffed into the top level descriptor. It seems like it should be easier to pull values out of it than with the solid color. However, after attempting many variations, I can't figure it out. var desc = updateSolidColor(52,128,128); var objValue = desc.getObjectValue(charIDToTypeID( "T " )); objList = objValue.getList(charIDToTypeID( "Clr " )); rgbData = objList.getObjectValue(0); userRed = Math.round(rgbData.getDouble(charIDToTypeID( "Rd " ))); userGreen = Math.round(rgbData.getDouble(charIDToTypeID( "Grn " ))); userBlue = Math.round(rgbData.getDouble(charIDToTypeID( "Bl " ))); alert("red="+userRed+" "+"green="+userGreen+" "+"blue="+userBlue); function updateSolidColor(red,green,blue){ var id30 = charIDToTypeID( "setd" ); var desc7 = new ActionDescriptor(); var id31 = charIDToTypeID( "null" ); var ref2 = new ActionReference(); var id32 = stringIDToTypeID( "contentLayer" ); var id33 = charIDToTypeID( "Ordn" ); var id34 = charIDToTypeID( "Trgt" ); ref2.putEnumerated( id32, id33, id34 ); desc7.putReference( id31, ref2 ); var id35 = charIDToTypeID( "T " ); var desc8 = new ActionDescriptor(); var id36 = charIDToTypeID( "Clr " ); var desc9 = new ActionDescriptor(); var id37 = charIDToTypeID( "Rd " ); desc9.putDouble( id37, red ); var id38 = charIDToTypeID( "Grn " ); desc9.putDouble( id38, green ); var id39 = charIDToTypeID( "Bl " ); desc9.putDouble( id39, blue ); var id40 = charIDToTypeID( "RGBC" ); desc8.putObject( id36, id40, desc9 ); var id41 = stringIDToTypeID( "solidColorLayer" ); desc7.putObject( id35, id41, desc8 ); return executeAction( id30, desc7, DialogModes.ALL ); }
... View more
‎Apr 12, 2017
09:03 PM
I'm not trying to record the manual brush stokes, just the slider values. The script listener records the Select and Mask just fine. It will also apply the Select and Mask through the function, minus any manual brush strokes. I can give it parameters for the sliders and it will apply them with no issues. I just want to record the the slider values for the smart radius, feather, contrast, smooth, and shift edge when the user changes them.
... View more
‎Apr 12, 2017
06:45 PM
I'm trying to collect the user input information from Select and Mask so the user's values can be saved into script presets. I got the Select and Mask code from script listener. This is what I came up with to attempt to retrieve the value for the smart radius. I figured if I can get that to work then I can get the other values using the same method. It puts it into an action descriptor OK. However, it errors on line 2 with Error 8800 "General Photoshoip error. This functionality may not be available". var desc=selectAndMask(0,0,0,0,0); smartRad=desc.getInteger(stringIDToTypeID( "smartBrushRadius" )); alert(smartRad); function selectAndMask(radius,smooth,feather,contrast,shift){ var idsmartBrushWorkspace = stringIDToTypeID( "smartBrushWorkspace" ); var desc136 = new ActionDescriptor(); var idsmartBrushRadius = stringIDToTypeID( "smartBrushRadius" ); desc136.putInteger( idsmartBrushRadius, radius ); var idsmartBrushSmooth = stringIDToTypeID( "smartBrushSmooth" ); desc136.putInteger( idsmartBrushSmooth, smooth ); var idsmartBrushFeather = stringIDToTypeID( "smartBrushFeather" ); var idPxl = charIDToTypeID( "#Pxl" ); desc136.putUnitDouble( idsmartBrushFeather, idPxl, feather ); var idsmartBrushContrast = stringIDToTypeID( "smartBrushContrast" ); var idPrc = charIDToTypeID( "#Prc" ); desc136.putUnitDouble( idsmartBrushContrast, idPrc, contrast ); var idsmartBrushShiftEdge = stringIDToTypeID( "smartBrushShiftEdge" ); var idPrc = charIDToTypeID( "#Prc" ); desc136.putUnitDouble( idsmartBrushShiftEdge, idPrc, shift ); var idsampleAllLayers = stringIDToTypeID( "sampleAllLayers" ); desc136.putBoolean( idsampleAllLayers, false ); var idsmartBrushUseSmartRadius = stringIDToTypeID( "smartBrushUseSmartRadius" ); desc136.putBoolean( idsmartBrushUseSmartRadius, true ); var idsmartBrushDecontaminate = stringIDToTypeID( "smartBrushDecontaminate" ); desc136.putBoolean( idsmartBrushDecontaminate, false ); var idrefineEdgeOutput = stringIDToTypeID( "refineEdgeOutput" ); var idrefineEdgeOutput = stringIDToTypeID( "refineEdgeOutput" ); var idselectionOutputToUserMask = stringIDToTypeID( "selectionOutputToUserMask" ); desc136.putEnumerated( idrefineEdgeOutput, idrefineEdgeOutput, idselectionOutputToUserMask ); return executeAction( idsmartBrushWorkspace, desc136, DialogModes.ALL ); }
... View more
‎Apr 01, 2017
12:55 PM
Thanks for the reply. I downloaded and checked it out but it's way to confusing for me to figure out. All I wanted to do was get the current Hours, Minutes, Seconds and Frame from he timeline into 4 variables. I couldn't figure out how to do that with the code in the download. Anyway, I think I'm just giving up on that now and moving on to something else. I really wish that Adobe would update the DOM and the documentation for it. Piecing together cryptic code to attempt to do simple things is too complex for a simple minded script writer such as myself.
... View more
‎Mar 28, 2017
02:19 PM
I've been trying to find a way to retrieve the timecode data for hours, minutes, seconds and frame for the current position in a Video in Photoshop. The script listener will record when the current active frame is changed. I can't seem to piece together anyway to get the data. I've spent all day trying to figure this out. Any action manager coding experts out there that know how to do this? This is the script listener code it gives when changing the current active frame. I figured this info could be used to make function to get the data. // ======================================================= var idsetd = charIDToTypeID( "setd" ); var desc405 = new ActionDescriptor(); var idnull = charIDToTypeID( "null" ); var ref80 = new ActionReference(); var idPrpr = charIDToTypeID( "Prpr" ); var idtime = stringIDToTypeID( "time" ); ref80.putProperty( idPrpr, idtime ); var idtimeline = stringIDToTypeID( "timeline" ); ref80.putClass( idtimeline ); desc405.putReference( idnull, ref80 ); var idT = charIDToTypeID( "T " ); var desc406 = new ActionDescriptor(); var idhours = stringIDToTypeID( "hours" ); desc406.putInteger( idhours, 1 ); var idminutes = stringIDToTypeID( "minutes" ); desc406.putInteger( idminutes, 2 ); var idseconds = stringIDToTypeID( "seconds" ); desc406.putInteger( idseconds, 57 ); var idframe = stringIDToTypeID( "frame" ); desc406.putInteger( idframe, 29 ); var idframeRate = stringIDToTypeID( "frameRate" ); desc406.putDouble( idframeRate, 29.970000 ); var idtimecode = stringIDToTypeID( "timecode" ); desc405.putObject( idT, idtimecode, desc406 ); executeAction( idsetd, desc405, DialogModes.NO ); Also, the 2 functions below work for getting the total frame count and frame rate. I found an old posting by Mike Hale showing how to get the total frame count and I was able to use the same method to get the frame rate as well. However, using the same method doesn't seem to work for the hours, minutes, seconds and frame. I have tried dozens of ways to patch together AM code to do it. I'm guess that it is possible but I just don't understand action manager code well enough to figure it out. These functions work for frame count and frame rate... function getTotalFrameCount(){ var ref = new ActionReference(); ref.putProperty( charIDToTypeID( "Prpr" ), stringIDToTypeID( "frameCount" ) ); ref.putClass( stringIDToTypeID( "timeline" ) ); var desc = new ActionDescriptor(); desc.putReference( charIDToTypeID( "null" ), ref ); var resultDesc = executeAction( charIDToTypeID( "getd" ), desc, DialogModes.NO ); return resultDesc.getInteger( stringIDToTypeID( "frameCount" ) ); } function getFrameRate(){ var ref = new ActionReference(); ref.putProperty( charIDToTypeID( "Prpr" ), stringIDToTypeID( "frameRate" ) ); ref.putClass( stringIDToTypeID( "timeline" ) ); var desc = new ActionDescriptor(); desc.putReference( charIDToTypeID( "null" ), ref ); var resultDesc = executeAction( charIDToTypeID( "getd" ), desc, DialogModes.NO ); return resultDesc.getDouble( stringIDToTypeID( "frameRate" ) ); }
... View more
‎Mar 27, 2017
06:39 PM
I found an old post by Mike Hale showing how to get the total frame count which works. I tried applying this same method to get the frame rate and the current frame hours, seconds, minutes and frame. The frame rate function works but not the hours,minutes,second and frame. I think those link to "timecode" instead of "timeline". The script listener function to goto a specific timecode works. I was trying to piece together AM code to get the current the hours, minutes, seconds and frame based on the info in the script listener code but. I tried MANY combinations of things but couldn't get anything to work. Honestly, I have a hard time wrapping my brain around AM code. Any ideas on how to get the hours,minutes,seconds and frame functions to work? function getTotalFrameCount(){ var ref = new ActionReference(); ref.putProperty( charIDToTypeID( "Prpr" ), stringIDToTypeID( "frameCount" ) ); ref.putClass( stringIDToTypeID( "timeline" ) ); var desc = new ActionDescriptor(); desc.putReference( charIDToTypeID( "null" ), ref ); var resultDesc = executeAction( charIDToTypeID( "getd" ), desc, DialogModes.NO ); return resultDesc.getInteger( stringIDToTypeID( "frameCount" ) ); } function getFrameRate(){ var ref = new ActionReference(); ref.putProperty( charIDToTypeID( "Prpr" ), stringIDToTypeID( "frameRate" ) ); ref.putClass( stringIDToTypeID( "timeline" ) ); var desc = new ActionDescriptor(); desc.putReference( charIDToTypeID( "null" ), ref ); var resultDesc = executeAction( charIDToTypeID( "getd" ), desc, DialogModes.NO ); return resultDesc.getDouble( stringIDToTypeID( "frameRate" ) ); } function getFrameHours(){ var ref = new ActionReference(); ref.putProperty( charIDToTypeID( "Prpr" ), stringIDToTypeID( "hours" ) ); ref.putClass( stringIDToTypeID( "timeline" ) ); var desc = new ActionDescriptor(); desc.putReference( charIDToTypeID( "null" ), ref ); var resultDesc = executeAction( charIDToTypeID( "getd" ), desc, DialogModes.NO ); return resultDesc.getInteger( stringIDToTypeID( "hours" ) ); } function getFrameMinutes(){ var ref = new ActionReference(); ref.putProperty( charIDToTypeID( "Prpr" ), stringIDToTypeID( "minutes" ) ); ref.putClass( stringIDToTypeID( "timeline" ) ); var desc = new ActionDescriptor(); desc.putReference( charIDToTypeID( "null" ), ref ); var resultDesc = executeAction( charIDToTypeID( "getd" ), desc, DialogModes.NO ); return resultDesc.getInteger( stringIDToTypeID( "minutes" ) ); } function getFrameSeconds(){ var ref = new ActionReference(); ref.putProperty( charIDToTypeID( "Prpr" ), stringIDToTypeID( "seconds" ) ); ref.putClass( stringIDToTypeID( "timeline" ) ); var desc = new ActionDescriptor(); desc.putReference( charIDToTypeID( "null" ), ref ); var resultDesc = executeAction( charIDToTypeID( "getd" ), desc, DialogModes.NO ); return resultDesc.getInteger( stringIDToTypeID( "seconds" ) ); } function getFrame(){ var ref = new ActionReference(); ref.putProperty( charIDToTypeID( "Prpr" ), stringIDToTypeID( "frame" ) ); ref.putClass( stringIDToTypeID( "timeline" ) ); var desc = new ActionDescriptor(); desc.putReference( charIDToTypeID( "null" ), ref ); var resultDesc = executeAction( charIDToTypeID( "getd" ), desc, DialogModes.NO ); return resultDesc.getInteger( stringIDToTypeID( "frame" ) ); } function goToFrame(h,m,s,f,r){ var idsetd = charIDToTypeID( "setd" ); var desc14 = new ActionDescriptor(); var idnull = charIDToTypeID( "null" ); var ref2 = new ActionReference(); var idPrpr = charIDToTypeID( "Prpr" ); var idtime = stringIDToTypeID( "time" ); ref2.putProperty( idPrpr, idtime ); var idtimeline = stringIDToTypeID( "timeline" ); ref2.putClass( idtimeline ); desc14.putReference( idnull, ref2 ); var idT = charIDToTypeID( "T " ); var desc15 = new ActionDescriptor(); var idhours = stringIDToTypeID( "hours" ); desc15.putInteger( idhours, h ); var idminutes = stringIDToTypeID( "minutes" ); desc15.putInteger( idminutes, m ); var idseconds = stringIDToTypeID( "seconds" ); desc15.putInteger( idseconds, s ); var idframe = stringIDToTypeID( "frame" ); desc15.putInteger( idframe, f ); var idframeRate = stringIDToTypeID( "frameRate" ); desc15.putDouble( idframeRate, r ); var idtimecode = stringIDToTypeID( "timecode" ); desc14.putObject( idT, idtimecode, desc15 ); executeAction( idsetd, desc14, DialogModes.NO ); }
... View more
‎Mar 27, 2017
02:28 AM
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.
... View more
‎Mar 26, 2017
05:26 PM
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?
... View more
‎Mar 26, 2017
09:40 AM
Thanks, I'll look into the Github doc you posted.
... View more
‎Mar 26, 2017
09:39 AM
I'll be looking forward to seeing the AM code documentation that Davide comes up with.
... View more