jazz-y
Guide
jazz-y
Guide
Activity
‎Apr 26, 2020
12:55 AM
I wanted to make sure that the user did not notice that the script was actually restarted during the editing of the settings (that is, completely restore the state of the windows at the time the script was closed). As a result, I had to make the main window with a list of settings appear after editing the option. This is not very logical, but could not find a better solution.
... View more
‎Apr 24, 2020
02:36 PM
1 Upvote
You are totally right, it works perfectly once you understand the principle of Environments Variables. I learnt this thanks to you. Very powerful and simple method. You are the best, thank you again:)
... View more
‎Apr 20, 2020
08:27 AM
just what I was looking for Thank you
... View more
‎Apr 15, 2020
08:28 AM
DmitryEgorov It works very well Thank you
... View more
‎Apr 14, 2020
06:37 AM
‎Apr 14, 2020
06:24 AM
Thanks a lot!
... View more
‎Apr 09, 2020
06:36 AM
1 Upvote
Works. But in this case, another error appears - "you can not pley the action during playback 🙂". The problem arises because I use app.playbackParameters.count in order to determine if the script is running from the menu or from the action panel. When a menu command is inserted into an action, the script considers that it is launched from the menu and tries to work in normal mode (i.e., find and launch the action) - this behavior is blocked by Photoshop with an error message.
... View more
‎Apr 08, 2020
02:56 AM
This is a good idea, but I'm using the layerSectionEnd to find each end of each group in the layer stack. I need to know the index of this "layer" in order to find the first layerSectionContent of each layerSet. The "mistake" the code is making is with just a few layers. Everything else was working perfectly. Thanks
... View more
‎Apr 02, 2020
06:01 PM
JJMack, you are right. I was trying to combine both tasks in one script. Thanks
... View more
‎Apr 02, 2020
12:23 AM
Habe dies in der Testversion versucht. Ergebnis nicht annähernd gut. Rolf Staub Schrofenweg 4 73066 Uhingen rolf.staub@online.de.
... View more
‎Mar 24, 2020
11:19 AM
2 Upvotes
Text size you add to a document must be appropriate for the document size. The step records the text size you used adding text to some size document. That action step recorded you text some size you chose for your document size. The Actions step will always add that size text. A trick I use in actions is to add the text layer to a document that has of width of 8"??? What I do is use an Image size step before adding the texts layer where resample is not checked and I set the document with to 8". I Have Photoshop set the appropriate Print resolution. The action then add the texts layer with text sized for an 8" wide image the text size I chose recording the action. The Image Size step does not change your image at all. Not a single pixel is changed all that photoshop did was set the appropriate Print PPI.
Wrote a simple action script utility to save and restore a document print resolution. The I can run in the action before the Image size step and after the add text layer step in it is important bot to change the document print resolution. Adobe add a bug the Scripting support in Photoshop 2015.5. The get Around this bug I add Garbage to document info meta data field via Photoshop Script event manager even handlers for new and open events if Garbage in not in the field the handler will add the garbage. That garbage being there allow met scripts toe work correctly. Adobe allows my scripts to restore the field to Garbage the Adobe Bug prevent my scripts from restoring the field to nothing to empty its default state.
Apparently some Adode engineer believe braking photoshop helps other applications I wonder what product they work on. Why is preventing me fron removing my data helping some application. The only Adobe Application I use is Photoshop. It not helping Photoshop.
So I fix Garbage with Garbage.
... View more
‎Mar 20, 2020
11:18 AM
1 Upvote
moveLayerSetWithMask(app.activeDocument.layerSets[0], 0, new UnitValue(20, 'px'))
function moveLayerSetWithMask(lrSet, dH, dV) {
var id = lrSet.id
if (hasLayerUserMask(id)) {
var linked = getUserMaskLinkedState(id)
setUserMaskLinkedState(id, true)
lrSet.translate(dH, dV)
setUserMaskLinkedState(id, linked)
} else {
lrSet.translate(dH, dV)
}
function setUserMaskLinkedState(id, linked) {
desc = new ActionDescriptor(),
desc2 = new ActionDescriptor(),
ref = new ActionReference()
ref.putIdentifier(s2t("layer"), id)
desc.putReference(s2t("null"), ref)
desc2.putBoolean(s2t("userMaskLinked"), linked)
desc.putObject(s2t("to"), s2t("layer"), desc2)
executeAction(s2t("set"), desc, DialogModes.NO)
}
function getUserMaskLinkedState(id) {
ref = new ActionReference()
ref.putProperty(s2t("property"), s2t("userMaskLinked"))
ref.putIdentifier(s2t("layer"), id)
return executeActionGet(ref).getBoolean(s2t("userMaskLinked"))
}
function hasLayerUserMask(id) {
ref = new ActionReference()
ref.putProperty(s2t("property"), s2t("hasUserMask"))
ref.putIdentifier(s2t("layer"), id)
return executeActionGet(ref).getBoolean(s2t("hasUserMask"))
}
function s2t (s) { return app.stringIDToTypeID(s) }
}
... View more
‎Mar 18, 2020
11:26 PM
1 Upvote
Menu selection commands return an empty descriptor. We do not know state of menu item before executeAction command and after. We can only switch it.
... View more
‎Mar 17, 2020
12:15 AM
I have downloaded right version. Thanks!
... View more
‎Mar 13, 2020
11:30 AM
Further distinction: on further testing, discover the Options dialog I had tried using was the Quick Mask Mode Options dialog. Except for the title bar, it is identical to the New Channel options dialog. Changing the options on the Quick Mask Mode Options dialog did not change the behavior when the action was run. Changing the option in the New Channel options dialog did, however, change the outcome of the action. Appreciate immensely having the solution.
... View more
‎Mar 04, 2020
07:46 AM
I noticed ScriptListener creates 'javaScriptMessage' with """1""" value when in triggered code Window exists with OK button that then is pressed, and 2 when cancel button is pressed. So the same as win.show() returns.
I was not able to use those values for 'javaScriptMessage' to trigger script with clicked OK or Cancel button.
Probably it's only information for Photoshop listener, to note result of called script, but what for, I don't know.
... View more
‎Feb 21, 2020
01:18 PM
1 Upvote
w.active = true;
I see this more commonly on the Mac, where a new window doesn't have focus.
... View more
‎Feb 15, 2020
10:41 PM
Thanks. A few messages above i found some solution
... View more
‎Feb 08, 2020
01:48 PM
Thanks. This is easier than I thought.
... View more
Community Expert
in Photoshop ecosystem Discussions
‎Jan 25, 2020
10:13 PM
2 Upvotes
‎Jan 25, 2020
10:13 PM
2 Upvotes
My suggestion is very close to the one supplied by Dmitry:
app.runMenuItem(stringIDToTypeID('placedLayerConvertToEmbedded'));
or
app.runMenuItem(stringIDToTypeID('placedLayerEmbedAll'));
... View more
‎Jan 23, 2020
10:22 PM
Great catch, Stephen. I noticed one of the files had the psd.png and your update corrected it. Thanks so much!
... View more
‎Jan 23, 2020
05:58 AM
A photo looks as if you are editing and saving photos using a much wider color space (such as Adobe RGB or ProPhoto) than smartphone screen can display. Smartphones do not know how to work with color profiles, so they simply read the values of the color coordinates from the file - because of this, a color shift occurs. Change the color profile settings in photoshop to fit the capabilities of most smartphones - sRGB or display P3 is best for this (or convert in that profile before export file) - in this case, you can save most of the image colors and its perception. Below is a simple example of how this happens - the photo on the left is converted to a proPhoto profile, and the photo on the right is assigned sRGB (simulation of how this color space displays the phone)
... View more
‎Jan 23, 2020
05:12 AM
1 Upvote
Also, in case anyone's wondering, or having similar problems, what I ended up doing was like this: (Most of these steps can be automated using Action with a few scripts thrown in) 1. Magic wand select a background pixel (like pixel (3,3)) and invert selection. (Optional for complex images) Intersect-select the part that contains text. Before you start, divide images into different folders based on their layout. Simple images that only contain text (or text in a rectangle with fancy borders) can be completely automated. Images with similar layout can also be automated (for example, if the text is all underneath an icon or something. I can use a script to intersect-select the bottom 20% (or bottom 30 px, etc.) of the image height to get the text selection). 2. Use the bounds of the resulting selection as the container coordinates for the text object. Crop image to selection and export as png to a folder for optimal OCR results. Undo last action, Layer via cut, rename new layer "text" (or something consistent, for easier automation). Save as .psd file. 3. Use OCR software (I used Tesseract OCR combined with Windows Powershell to loop through all images in a folder) to turn the png you exported in Step 2 into .txt files of the same name. 4. Write script that gets the activeDocument name and looks for a txt file with the same name in the same folder, copy txt file content to a newly created text layer. Resize text layer according to the width of the layer named "text" in the psd file. Position it like the "text" layer. Create rectangle (positioned like the "text" layer) filled with solid color taken from a color sampler taken at a background pixel. Save and export. The tricky thing is to get the text color right. Any ideas? Maybe like get the second most dominant color in the image as text color? Fortunately the text mostly alternates between five or six fixed colors, but still...
... View more
‎Jan 21, 2020
09:10 PM
1 Upvote
Hi DmitryEgorov, Thank you so much for the detailed explanation. your timely help much appreciated. -yajiv
... View more
‎Jan 17, 2020
06:34 AM
2 Upvotes
I see my mistake now. Thank you! When I clicked on "Insert Menu Item" from the actions menu, when the pop up window said "menu item not selected" I closed that menu instead of keeping it open, select menu itemTHEN click ok. So for those also confused about the steps out there. -Insert menu item in Actions Tab -(Pop up menu) says to record menu item, select a menu item. Keep this window open. -Select menu item. -Then click ok on the pop up window. Thank you so much for your guidance and patience. I appreciate it a lot.
... View more
‎Jan 10, 2020
12:07 PM
1 Upvote
Run replace content for the smart object in CS2 and in all subsequent versions. Pay particular attention to the use of files with different resolutions. As they say - feel the difference. So what kind of idiot from Adobe thought of changing behavior?
... View more
‎Jan 07, 2020
03:17 PM
1 Upvote
Make it to work faster by using:
ref.putProperty(stringIDToTypeID('property'), stringIDToTypeID('layerEffects'))
after:
var ref = new ActionReference()
then before last line such 3 lines use again but with 'layerEffects' replaced by 'globalAngle'
btw anyone know why I can see coloured code during posting (when set to JavaScript language) but when I visit the topic with the colored code, it only flicks for one second to turn into grey?
... View more
‎Jan 07, 2020
03:04 PM
As it involves Bridge, here's dedicated Bridge Scripting Forum
... View more
‎Jan 07, 2020
06:29 AM
Try this. Just make sure you're on your path layer, when you run the script.
#target photoshop
var red = 255;
var green = 0;
var blue = 0;
var size = 20;
var origC = new SolidColor();
origC=foregroundColor;
var doc = activeDocument;
var pathLayer = doc.activeLayer;
doc.artLayers.add();
var pixelLayer = doc.activeLayer;
var foregroundC = new SolidColor();
foregroundC.rgb.red = red;
foregroundC.rgb.green = green;
foregroundC.rgb.blue = blue;
foregroundColor = foregroundC;
doc.activeLayer = pathLayer;
var ptArray = [];
var thePath = doc.pathItems[0].subPathItems[0];
var nodeNum = doc.pathItems[0].subPathItems[0].pathPoints.length;
for(var i=0;i<nodeNum;i++){
ptArray.push(thePath.pathPoints[i].anchor)
}
doc.activeLayer = pixelLayer;
for(var i=0;i<nodeNum;i++){
makePixelDot (ptArray[i][0], ptArray[i][1])
}
alert('There are '+nodeNum+' dots.')
foregroundColor = origC;
function makeLayer(){
var idMk = charIDToTypeID( "Mk " );
var desc10 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref4 = new ActionReference();
var idLyr = charIDToTypeID( "Lyr " );
ref4.putClass( idLyr );
desc10.putReference( idnull, ref4 );
var idLyrI = charIDToTypeID( "LyrI" );
desc10.putInteger( idLyrI, 9 );
executeAction( idMk, desc10, DialogModes.NO );
}
function makePixelDot(dotX,dotY){
var idDraw = charIDToTypeID( "Draw" );
var desc6 = new ActionDescriptor();
var idShp = charIDToTypeID( "Shp " );
var desc7 = new ActionDescriptor();
var idunitValueQuadVersion = stringIDToTypeID( "unitValueQuadVersion" );
desc7.putInteger( idunitValueQuadVersion, 1 );
var idTop = charIDToTypeID( "Top " );
var idPxl = charIDToTypeID( "#Pxl" );
desc7.putUnitDouble( idTop, idPxl, dotY-size/2 );
var idLeft = charIDToTypeID( "Left" );
var idPxl = charIDToTypeID( "#Pxl" );
desc7.putUnitDouble( idLeft, idPxl, dotX-size/2 );
var idBtom = charIDToTypeID( "Btom" );
var idPxl = charIDToTypeID( "#Pxl" );
desc7.putUnitDouble( idBtom, idPxl, dotY+size/2 );
var idRght = charIDToTypeID( "Rght" );
var idPxl = charIDToTypeID( "#Pxl" );
desc7.putUnitDouble( idRght, idPxl, dotX+size/2 );
var idElps = charIDToTypeID( "Elps" );
desc6.putObject( idShp, idElps, desc7 );
var idAntA = charIDToTypeID( "AntA" );
desc6.putBoolean( idAntA, true );
executeAction( idDraw, desc6, DialogModes.NO );
}
... View more
‎Jan 06, 2020
01:10 PM
1 Upvote
I looked at the Jaroslav Bereza code and saw that it is possible to use a different approach, compatible with earlier versions of Photoshop, which may be of interest to the author of the topic. This can be briefly described by the following set of menu commands: Convert Smart Object to Linked file and save it in temp dir (if it has graphical content, that can be edited in the Photoshop environment, otherwise (if it is, for example, a vector file from AI), this command will be unavailable) -> open this file in Photoshop and work with its content as with a regular document -> close & save -> run "Embed linked" command in parent document -> delete linked file In this case, there will be no problems with the transformation and effects and at the same time we can control the contents of the smart object (without replacing it completely) (I think that it is worth voicing any working solution, maybe it will be useful to someone)
... View more
- « Previous
- Next »