It looks like you will have to turn off the visibility of all the other layers to get the max value from the histogram.
Re: How to get the maximum value of the image RGB
Photoshop not visually updating while script is running?
I wrote a script that SHOULD loop through every frame in my timeline as if it was playing the timeline, however Photoshop doesn't update when I move from frame to frame. I know its going to the frame but almost in the background. I'm wondering why it doesn't just visually show me each frame in my animation. Here is my script now and my play Timeline function is what isn't working. Feel free to try it out to see what I mean.
var doc = app.activeDocument; var frameCount = getFrameCount(); playTimeline(); function playTimeline() { frameCount = getFrameCount(); firstFrame(); for(var i = 1; i < frameCount;i++){ goToFrame(i); $.sleep(getDelay(i) * 1000); } } function getDelay (frame) { var ref = new ActionReference(); ref.putProperty(charIDToTypeID('Prpr'), stringIDToTypeID('animationFrameDelay')); ref.putIndex(stringIDToTypeID('animationFrameClass'), frame); var desc = new ActionDescriptor(); desc.putReference(charIDToTypeID('null'), ref); var T = executeAction(charIDToTypeID('getd'), desc, DialogModes.NO); return T.getDouble(stringIDToTypeID('animationFrameDelay')); } function getFrameCount() { var count = 1; while (goToFrame(count) != false) { count++; } return count - 1; } function goToFrame(frame) { try { var desc = new ActionDescriptor(); var ref = new ActionReference(); ref.putIndex(stringIDToTypeID("animationFrameClass"), frame); desc.putReference(charIDToTypeID("null"), ref); executeAction(charIDToTypeID("slct"), desc, DialogModes.NO); return true; } catch (e) {} return false; } function firstFrame(){ var desc = new ActionDescriptor(); var ref = new ActionReference(); ref.putEnumerated(stringIDToTypeID("animationFrameClass"), charIDToTypeID("Ordn"), charIDToTypeID("Frst")); desc.putReference(charIDToTypeID("null"), ref); executeAction(stringIDToTypeID("animationFrameActivate"), desc, DialogModes.NO ); }
Re: Photoshop not visually updating while script is running?
Perhaps if you replace the sleep with an application refresh you would see each frame the rate may be very slow. Replace your sleep with statement with app.refresh(); You may want to check if the scritlistener records any code when you use the timeline play button and use its play feature. Position to frame then use play. Play may not be record-able though.
Re: Photoshop not visually updating while script is running?
Yeah so this works now with app.refresh() but as you said its slow and the delays are thrown off as I want them to be at least 0.1 sec of delay. Is there no way you can update the app without it taking so long? (Also the play button in the timeline is not record-able.) Thanks!
Re: How do i view all messages in scripting forum?
thanks Chuck... for whatever reason, the numbers weren't there, but I clicked something and they're there now - no idea what I did lol. The format of these forums don't appear to be standard so I find them somewhat confusing to navigate.
Re: Photoshop not visually updating while script is running?
I think to only way you will be able to do want you want to see is to save out an animated gif or mp4 and view it in a html panel like Save for web preview in browser.
Re: How do i view all messages in scripting forum?
Yea, no kidding!
Re: Photoshop not visually updating while script is running?
Alright, I'll try and find a work around then, thanks anyway!
Re: To create folder and move a specific number of files
Script problem with pc
Can the version of photoshop (32-bit CS5 - 64-bit CS5) change the result of a script?
The same script on 2 pc with Windows 7 pro, produces 2 different results; A good and a bad!
I can not understand why ?!
Re: Move snapshop in layer
Hi Tssee,
There is no way to achieve it however you can post a feature request on the link below.
Photoshop Family Customer Community
Regards,
Sahil
Re: To create folder and move a specific number of files
Hi sarshan,
same principle as in your last thread:
// for Windows var folder1 = Folder("/x/qa/Team/Saravanan"); if (!folder1.exists) {folder1.create();}
rewritten
// for Windows var curFolder = new Folder("/x/qa/Team/Saravanan/mergefiles/guna");
Have fun
Re: Script problem with pc
Which code?
What is the difference in the result?
Removing numbers from file names when exporting layers to files???
I am running CC 2017 and have not found a working way to edit the script to remove the numbers at the beginning of the file name when exporting layers to files. I did this for CS6, but every tutorial I find does not show me how to do it in CC 2017. I keep finding tutorials for CC 2015, but the line numbers given in every tutorial I have found does not match the line numbers in the .jsx file I have on my system.
Re: Move snapshop in layer
Hi Sahil.Chawla
Never say never.
(This is the scripting forum )
one possible way to go (AM-Code is your friend):
count the snapshots
create a new snapshot
go to the last snapshot (before the new created one)
select all
copy
// if necessary add a new layer at the top
paste
create a new snapshot (overwrite the last one or remove the last one and create a new one)
go to the last snapshot (before the new created one)
select all
copy
// if necessary add a new layer at the top
paste
and so on …
Have fun
Re: Move snapshop in layer
Thank you
Re: To create folder and move a specific number of files
Thank you
It's very useful
Excluding Thumbs.db from Getfiles()
I've scripted a program for ps and one of the steps gathers the files. unfortunately, one of our team members is on an earlier version of windows and a thumbs.db keeps getting into the getfiles() return.
I was wondering if there is a way to filter out this file from the request.
thanks!
Re: To create folder and move a specific number of files
You're welcome.
Credits should go to Chuck Uebele
sarshan, did you tried his script snippet? Does it works for you?
Re: Excluding Thumbs.db from Getfiles()
I would suggest a whitelist (files you llike) and not a blacklist (files you do not like). Find the files you WANT to process. Image Processor script has this function
function IsFileOneOfThese( inFileName, inArrayOfFileExtensions ) {
And gets a list of extensions that Photoshop knows how to open (see gFileExtensionsToRead). (And deals with those pesky users that don't have an extension!)
if (IsFileOneOfThese( cameraRawParams.fileName, gFileExtensionsToRead ) ||
IsFileOneOfTheseTypes( cameraRawParams.fileName, gFileTypesToRead ) ) {