Ghoul Fool
Engaged
Ghoul Fool
Engaged
Activity
‎Feb 24, 2023
04:39 PM
Do you want better than this?
https://theiviaxx.github.io/photoshop-docs/Photoshop/Document/suspendHistory.html
Good luck!
All jokes aside, there are many things where one just has to "accept" that is how Adobe created them and just move on, otherwise the path leads to insanity. :]
I wish I could answer why the second param is a string, but I can't!
... View more
‎Jan 30, 2023
01:27 AM
I suspect you're right I probably am running out of disk space on C:\ For what it's worth here's the script. It changes 16 bit images to 8 bit save and closes them or just closes them if they are not 16 bits per channel. // Switch off any dialog boxes
displayDialogs = DialogModes.NO; // OFF
var inFolder = Folder.selectDialog("Please select folder to process");
if (inFolder != null)
{
var fileList = inFolder.getFiles(/\.(png)$/i);
}
var num = fileList.length;
main(fileList);
// Switch any dialog boxes back on again
displayDialogs = DialogModes.ALL; // ALL ON AGAIN
function main(flist)
{
var bits = 8;
for (var i = 0; i < flist.length; i++)
{
// open file
open_it(flist[i]);
// call the source document
var srcDoc = app.activeDocument;
// if there's a document open
// changes it's bit depth
if (documents.length != 0)
{
if(srcDoc.bitsPerChannel == "BitsPerChannelType.SIXTEEN")
{
change_bits_per_channel(bits);
save_and_close_it();
}
else close_it();
} // end documents.length != 0
}
}
function change_bits_per_channel(x)
{
// =======================================================
var idCnvM = charIDToTypeID( "CnvM" );
var desc28 = new ActionDescriptor();
var idDpth = charIDToTypeID( "Dpth" );
desc28.putInteger( idDpth, x ); // bits per channel
var idMrge = charIDToTypeID( "Mrge" );
desc28.putBoolean( idMrge, false );
executeAction( idCnvM, desc28, DialogModes.NO );
}
// function CLOSE IT()
// --------------------------------------------------------
function close_it()
{
// close the image WITHOUT saving
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
}
// function SAVE AND CLOSE IT
// ----------------------------------------------------------------
function save_and_close_it()
{
app.activeDocument.close(SaveOptions.SAVECHANGES);
}
// function OPEN IT (filename & path)
// --------------------------------------------------------
function open_it(afilepath)
{
// simple version
var theFile = new File(afilepath);
if (theFile.exists)
{
var id511 = charIDToTypeID( "Opn " );
var desc109 = new ActionDescriptor();
var id512 = charIDToTypeID( "null" );
desc109.putPath( id512, new File(afilepath) );
executeAction( id511, desc109, DialogModes.NO );
}
else // file doesn't exist
{
// alert("Cannot open\n" + afilepath);
}
}
... View more
‎Jan 20, 2023
03:56 AM
Remind me to look into windows that are duplicated. - ie New window for (Window > Arrange > new window for doc XYZ) As those aren't covered int he same way.
... View more
Community Expert
in Photoshop ecosystem Discussions
‎Jan 14, 2023
01:20 AM
1 Upvote
‎Jan 14, 2023
01:20 AM
1 Upvote
@jazz-y – All good, I always hope that a more experienced scripter will post their code, even if I have already contributed code, that way we all benefit!
... View more
‎Dec 28, 2022
01:18 PM
1 Upvote
That seems to be just a part of the correction script. This link has more info and the other components as well http://www.rags-int-inc.com/PhotoTechStuff/ColorCalculator/AdobeMath.html
... View more
‎Dec 17, 2022
09:02 AM
That's is indeed a good point @Stephen Marsh me tions here. It's all last opened files. I got my little doodle working now. I'm going to expand it a bit more though Edit But there could be a solution though. If you start saving through a script from now on. You would be able to form a list of saved files, say a json file, actually anything will work. Using that option will work and get a list of of only saved file path locations.
... View more
‎Dec 14, 2022
12:02 PM
However, the answer remains the same - Photoshop doesn't provide any additional information to separate the system font from the typeKit font. Especially if the font is removed.
The only way is to interact with the list of fonts at fonts.adobe.com. You can collect the names of all available fonts manually or write a standalone program that will interact with this site. In any case, this is already beyond the capabilities of scripts.
... View more
‎Dec 11, 2022
08:40 AM
Thanks jazz-y! I was sooooo close 🙂
... View more
‎Nov 12, 2022
01:53 AM
I sees wheres I gone wrong! 😉 All good now. Thank you.
... View more
‎Nov 09, 2022
01:44 PM
1 Upvote
Downloaded TypeKit font files didn't used to be encrypted, but I don't think we can discuss how to turn them back into regular OpenType files.
CC App has a built-in timer where activated fonts are deactivated after an amount of time idle. This would only be a problem if the computer was offline and couldn't connect to reactivate the fonts.
... View more
‎Nov 09, 2022
08:39 AM
Is there a way around this?
And don't say don't run two actions at the same time.
Why bother coming here to ask a question if you're going to pre-disregard the correct answer? Illustrator is single threaded. An action occupies that thread and does not relinquish control until the action is completed. Illustrator simply cannot do multiple nested concurrent actions. So there is no answer other than "don't run two actions at the same time".
The real solution is to just re-work your flow of control. You can still use multiple actions, you just can't nest action calls. If you have two separate actions you need to run, write a .jsx that runs both of those actions sequentially. If the problem is that you want to have an action that runs a script (which executes another action) so that you can use a hotkey to execute the script then simply don't use an action for this purpose. There are plenty of other options available for hotkeying scripts.
Lastly, I think i was able to figure out what you want to do here, but it was definitely confusing with the loose usage of the word "action" and "script" and it's definitely possible that i'm misunderstanding your goal/problem. For future questions, you can help us out (and improve the quality of the answers you receive) by being a little more intentional with word choices to avoid confusion.
... View more
‎Sep 14, 2022
07:20 AM
1 Upvote
Hi @Ghoul Fool ,
the article to that script by Marc Autret you linked to is from the year 2009.
Never tested Marc's script there on a recent version of InDesign.
Marc's script was written for InDesign CS4, I think that was released in 2008.
Dramatic changes took place in the overall architecture of InDesign between CS4 and CS5 released in 2010.
InDesign CS4 had a totally different model of pages and spreads compared to CS5 where the first time in the history of InDesign a document could hold different page sizes. With CS4 this was not the case. Just to note one thing.
And yet another one: In InDesign CS4 you could return a collection of items with item("string") if the parent contained more than one with the same name. This option was gone with InDesign CS5 from about 2010. At least for most objects you can address with a string.
Regards, Uwe Laubender ( Adobe Community Professional )
... View more
‎Sep 05, 2022
06:03 AM
1 Upvote
Cheers, Stephen! Got it! For my future self: var srcDoc = app.activeDocument;
var rawData = srcDoc.xmpMetadata.rawData;
alert(find_text_layers(rawData));
function find_text_layers(str)
{
var regEx = new RegExp("\<photoshop:TextLayers\>", "gim");
var results = str.match(regEx);
if (results) return true;
else return false;
}
... View more
‎Sep 01, 2022
05:15 AM
1 Upvote
Cut and paste malfunction: THIS will do the trick: var inFolder = Folder.selectDialog("Please select folder to process");
if(inFolder != null)
{
var fileList = inFolder.getFiles(/\.(psd)$/i);
}
for (var i = 0; i < fileList.length; i++)
{
var f = fileList[i];
(d = new ActionDescriptor).putPath(stringIDToTypeID("target"), f);
executeAction(stringIDToTypeID("open"), d, DialogModes.NO);
}
// process image here
var srcDoc = app.activeDocument;
var docName = srcDoc.name;
... View more
‎Aug 04, 2022
05:49 AM
1 Upvote
I have an include file with my script pack where I define a couple of utility functions. It can be a prototype or just an object, either works fine.
... View more
‎Jul 14, 2022
08:42 AM
2 Upvotes
This is just result of interpreting the 'select' event by ScriptListner plugin. It receives the event object and parses its arguments sequentially, without thinking whether the resulting code is optimal or not.
In that case .putEnumerated() function takes three arguments - the class of the object, the type of the enumeration, and the value. That is, despite the fact that the object class and the enumeration type in this case have the same name, they actually describe different things. It seems logical to me that ScriptListner chose to represent them as separate variables.
We can optimize this code manually or use the script from the link given by @c.pfaffenbichler
The time spent on creating variables and getting a type value by name (using charIDToTypeID or stringIDToTypeID) is incomparably small in time with the executeAction function, so no, this does not affect the speed of scripts or actions in any way.
... View more
Community Expert
in Photoshop ecosystem Discussions
‎Jul 14, 2022
05:25 AM
2 Upvotes
‎Jul 14, 2022
05:25 AM
2 Upvotes
Indeed, not every function is available via DOM-code.
... View more
‎Jun 13, 2022
04:20 AM
This morning I've been getting pop-up alerts that I *think* are from Photoshop related to LogTransport2.exe, even though it looks DAF. So lots of questions: Is this legit? How do I stop it? What to do? If LogTransport2 is related to acrobat why do I get it when using Photoshop? And this was of no help whatsoever.
... View more
‎May 24, 2022
10:27 PM
I don't know, I avoid ScriptUI as much as possible!
As for JavaScript/Extendscript, there are of course case sensitive reserved words such as var or function etc.
https://www.w3schools.com/js/js_reserved.asp
... View more
‎Apr 06, 2022
06:16 AM
Nothing to say against challenging oneself and such but what do you need the individual patterns’ IDs for in a Script that creates several Patterns?
... View more
‎Mar 07, 2022
02:51 PM
1 Upvote
How do we get the Pixel/Centimeter information ImageSize window [through Javascript]
... View more
‎Mar 04, 2022
08:41 AM
2 Upvotes
The polish saying fits to this occurrence: where two guys fight each other, the third one gains 😄
Congratulation! You were that another that 'stole' the correct solution for the described problem 😛
... View more
‎Feb 24, 2022
07:17 AM
D'oh! Thank you once again.
... View more
Community Expert
in Photoshop ecosystem Discussions
‎Feb 22, 2022
03:51 AM
1 Upvote
‎Feb 22, 2022
03:51 AM
1 Upvote
I believe that there is one chapter dedicated to AM code.
... View more
‎Feb 18, 2022
01:50 AM
That's a tiny thing of beauty! Thank you.
... View more
‎Jan 08, 2022
09:03 AM
It seems r-bin solution is correct. Fell free to mark it so 🙂
... View more
‎Dec 07, 2021
08:30 AM
1 Upvote
The functions the original poster mentioned plus some more.
... View more
‎Dec 07, 2021
06:10 AM
I'm using Photoshop 19.1.6 on Win 7
... View more
‎Nov 23, 2021
07:32 AM
2 Upvotes
The RGB values are not stored directly as Hex. They are stored as 32 bit floating point numbers using a scale between 0 and 1. So each floating point number takes 4 bytes
R 0x3f800000 = decimal 1
G 0x3f57d7d8 = decimal 0.843137
B 0x00000000 = decimal 0
multiply each by 255 gives
R 255
G 215
B 0
Dave
... View more
‎Nov 11, 2021
08:28 AM
3 Upvotes
Determine layer color label from layer id?
... View more
- « Previous
- Next »