Script to frame multiple designs in various colours and save each image.
I sell prints online, and have a template of a frame, but I would like to know if there is a script which can be used to input maybe 10 image files into the frame template, and save each file as its own jpeg.
Hope that makes sense.
Thanks
Brilliant thank you, so how do I now use the below in PS (I am on CS5)
thanks again for your help
// replace smart object’s content and save psd;
// 2011, use it at your own risk;
#target photoshop
if (app.documents.length > 0) {
var myDocument = app.activeDocument;
var theName= myDocument.name.match(/(.*)\.[^\.]+$/)[1];
var thePath = myDocument.path;
var theLayer = myDocument.activeLayer;
// psd options;
psdOpts = new PhotoshopSaveOptions();
psdOpts.embedColorProfile = true;
psdOpts.alphaChannels = true;
psdOpts.layers = true;
psdOpts.spotColors = true;
// check if layer is smart object;
if (theLayer.kind != "LayerKind.SMARTOBJECT") {alert ("selected layer is not a smart object")}
else {
// select files;
if ($.os.search(/windows/i) != -1) {var theFiles = File.openDialog ("please select files", "*.psd;*.tif;*.jpg", true)}
else {var theFiles = File.openDialog ("please select files", getFiles, true)};
if (theFiles) {
// work through the array;
for (var m = 0; m < theFiles.length; m++) {
// replace smart object;
theLayer = replaceContents (theFiles[m], theLayer);
var theNewName = theFiles[m].name.match(/(.*)\.[^\.]+$/)[1];
//save jpg;
myDocument.saveAs((new File(thePath+"/"+theName+"_"+theNewName+".psd")),psdOpts,true);
////// get psds, tifs and jpgs from files //////
function getFiles (theFile) {
if (theFile.name.match(/\.(psd|tif)$/i) != null || theFile.constructor.name == "Folder") {
return true
////// replace contents //////
function replaceContents (newFile, theSO) {
app.activeDocument.activeLayer = theSO;
// =======================================================
var idplacedLayerReplaceContents = stringIDToTypeID( "placedLayerReplaceContents" );
var desc3 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
desc3.putPath( idnull, new File( newFile ) );
var idPgNm = charIDToTypeID( "PgNm" );
desc3.putInteger( idPgNm, 1 );
executeAction( idplacedLayerReplaceContents, desc3, DialogModes.NO );
return app.activeDocument.activeLayer
Similar Messages
-
Can I copy one frame of a movie using iMovie and save the frame as a file that can be printed like a picture? If so, how do I do that?
You could if you want a postcard sized print.
Printers need a lot more "dots" per inch and even a 1920X1080 video doesn't have enough "dots" to make more than a postcard.
Look at the "More Like This" links at the right side of this page for instructions. -
How to i write a script that makes multiple selections in a pdf and exports them to excel?
I have a large number of PDFs
Not all the PDFs contain information we need. We want to be able to automate a script that extracts certain info from the PDFs and opens them in a certain format in excel.
Acrobat allows me to make a single selection and export as excel.
How do i export multiple parts to excel from the pdfs and ensure that the resulting excel is in a format that i can use without much fixing needed (e.g. merged cells)?This type of process can't really be done using JavaScript. You would need to read the contents of the file, word by word, decide (based on some logic) what data to extract, and then collect it and at the end export to a plain-text file. Not a simple process...
-
Colour and Black & White Images
Hello,
I was just wondering about how can i classify or check if:
an image is colour or black and white?
Thank you very much for your help.Couple of ideas....
Some graphic file formats give the number of
colours.
if that is 2, then it's a monochrome picture
But I think the real question you're asking is, how
can I tell if an image is
grey scale.
You'd have to go through each pixel in the image, and
check.
When specifying colours in RGB, grey colours are
easy enough to check.
Eg.
( 0, 0, 0 ), ( 100, 100, 100 ), ( 148, 148, 148
)..... ( 255, 255, 255 )
So, if I'm correct.... the following function would
check a single pixel....
public boolean isGreyScale ( Colour aPixelColour )
int r = aPixelColour.getRed();
int g = aPixelColour.getGreen();
int b = aPixelColour.getBlue();
if ( ( r == g ) && ( g = b ) )
return ( true );
else
return ( false );
}regards,
OwenThe problem is that my program is a image searcher tool.
I have a large number of images and i need a good searching technique. If i have to go through each pixel in every image, it will take too long for an effective application.
thank you very much for your help -
How do I freeze a frame in a QT mpeg4 file and save as jpeg?
I've been trying to do this with set poster frame in QT 7 and it doesn't work. Or it may be working but I have no idea where it's putting the file.
In QT 10, there is no set poster frame choice. There must be a simple way of doing this, right? If you know, please share!
Thanx.Aren't you glad QT 10 is the 'newest' version?
You need to use QT7 that should be now in your utilities folder. Yes, lack of features is actually now a feature at Apple. I wonder what changed behind the scenes so that they had to cripple their flagship audio/video editing app and make people use two applications with the same name. -
Merge Multiple CSV Files Into One and save it into new file
Below code run in specific directory. However I'm looking a code which will select the folder & save it into new sheet.
Can you help me with this? I've searched for a solution for a long time but could not find anything which worked.
The following is the start of the macro code
Sub OpenCSV()
Dim i As Integer
' change this next line to reflect the actual directory
Const strDir = "C:\Documents and Settings\shekar\"
Dim ThisWB As Workbook
Dim wb As Workbook
Dim ws As Worksheet
Dim strWS As String
Set ThisWB = ActiveWorkbook
Set fs = Application.FileSearch
With fs
.LookIn = strDir
.Filename = "*.csv"
If .Execute(SortBy:=msoSortByFileName, _
SortOrder:=msoSortOrderAscending) > 0 Then
For i = 1 To .FoundFiles.Count
Set wb = Workbooks.Open(.FoundFiles(i))
strWS = wb.Sheets(1).Name
wb.Sheets(1).UsedRange.Copy (ThisWB.Worksheets(strWS).Range("A1"))
wb.Close False
Next i
Else
MsgBox "There were no files found."
End If
End With
End SubThe below will do the.But be careful if any of csv file name is more than 31 then Excel will not allow it to name the sheet with filename.
Sub OpenCSV()
Dim i As Integer
' change this next line to reflect the actual directory
Const strDir = "C:\Documents and Settings\shekar\"
Dim ThisWB As Workbook
Dim wb As Workbook
Dim ws As Worksheet
Dim strWS As String
Dim sFileName As String
Set ThisWB = ActiveWorkbook
With Application.FileDialog(msoFileDialogOpen)
.InitialFileName = strDir
.Filters.Clear
.Filters.Add "CSV Files", "*.csv"
If .Show Then
For i = 1 To .SelectedItems.Count
Set wb = Workbooks.Open(.SelectedItems(i))
sFileName = .SelectedItems(i)
Set ws = ThisWB.Worksheets.Add(before:=ThisWB.Worksheets(1))
ws.Name = ActiveSheet.Name
wb.Sheets(1).UsedRange.Copy ws.Range("A1")
wb.Close False
Next i
Else
MsgBox "There were no files found."
End If
End With
End Sub
Please do not forget to click “Vote as Helpful” if any post helps you and
Mark as Answer if it solves the issue. -
InDesign CS3 Scripting XML Import Multiple Images into same Text Frame
I am having trouble importing multiple images into the same Text Frame using XML import. I imported 5 images into the text frame. However, all 5 images are laying on top of one another. Does anyone know if there is a way to have all images laying out like how Microsoft Word handles inline images, i.e., laying out next image to the right of previsous image in the same line and if there is not enough space left in the line, then wrap to next line. Thanks in advance. I understand I could use JavaScript to do post import processing, e.g, calculate the image size and place each images accordingly. But I am trying to see whether there is a way to do this without scripts.
You can apply an object style to all anchored images by script. A text frame containing main flow should be selected.
var doc = app.activeDocument;
var textFrame = app.selection[0];
var rectangles = textFrame.texts[0].rectangles;
if (rectangles.length > 0) {
for (var i=0; i < rectangles.length; i++) {
rectangles[i].appliedObjectStyle = doc.objectStyles.item("Cover");
However, there is a better approach:
Step 1
Create place holders for a single "Book" element and format it as needed -- apply an object style to the cover.
Step 2
Import the xml file -- the placeholders are replaced with data from the 1st xml element
Step 3
Drag & drop the element containing all "Books" elements into the main flow -- all elements are placed and formatted the same way as in step 1.
Finally, add a new page, click the overset text icon and autoflow text to add pages so that to fit all the text.
Hope this helps.
Kasyan -
I used to use the iOpener plug-in to read a folder of images and present each image to me to edit/retouch. When I was done with the image, I clicked a button on a panel and it saved the resulting PSD in a designated destination folder and automagically retrieved the next image in the folder. Do this repeatedly until all images in the folder were processed. Fundy had a nice tool (Batch Editor), but it is end-of-life and not being offered anymore and iOpener seems to no longer be maintained. Target app is Photoshop CS6 / CC.
I want to build a simple set of scripts, embedded in a panel, that would let me replicate the basic function of these tools. Open an image from a selected folder. Let me do all the edits I want. Then save the result to a designated destination folder (or just a Save and Close), the serve up the next image.
I have many years of software development in other languages, but relatively new to adobe scripting so am looking for example code to get me heading the right direction. Also doesn't hurt to know whether something like this already exists and I can just use it.
Thanks!
-Mike Price
Fairfield PhotographyPERFECT!!!!!!
This is exactly what I was going to build. No need to create when it is already done.
Thank you very much.
-Mike -
Frame 10 crashes when I try to save the book file
Hi.
I open Frame docs that constitute a book, along with the book file. After working for a while, I save All Files In Book. This used to work just fine, but for the last couple of weeks it has been making Frame crash.
Frame also crashes if I'm not in the book file but try to save All Open Files, or if I try to save only the book file.
The docs were created in Frame 8, but I have had them open and changed and resaved them multiple times for the past several months with no issues until now.
I have recreated the book, but the same thing happens.
Has there been a recent update that might have affected this somehow? Or must I just stop using this helpful feature and save each chapter separately, and hope that the book file won't corrupt anything when I generate using it?
This has been quite frustrating, especially since it's a new development without any cause I can readily see.
Thanks for any help you can give.HI KayH123
First of all you need to rectify whether it is Framemaker specifi issue or is the issue of Internal Error is with the Book.
Create a test book with 1-2 documents from your original book, save it and observe you are facing the same issue or not.
If yes, then instead of original documents create test documents under test book. If also you face this then update Framemaker.
Now if Framemaker does not crash in new book then it means the issue is with the book that you created and may be inside the document in the book which is causing this issue.
Conatct Adobe Tech Support @ 800-833-6687
All the best
Thanks
VJ -
Colour Profiles on exported images causing major problems
I've been exporting keynote slides as png's to use in video presentations. The problem is that the png's are saved with colour profiles, which means if I export the images from diferent macs, or even the same mac but with a different monitor attached (therefore a diferent monitor colour profile active), the images have very noticeable colour variations.
This is a major problem. I exported 1,000 slide transitions to import into Adobe Premiere, then about 500 slide updates that when imported, were in some cases darker or lighter even though I was using the same keynote and original images. I had to create a batch job in Photoshop to open, ignore the stored profile and save the images using a new default colour profile to try and get all the images consistent.
There needs to be an option in either the Keynote preferences or export options to save exported images without colour profiles.There needs to be an option in either the Keynote preferences or export options to save exported images without colour profiles.
No, there needs to be documentation on the ICC architecture and how ICC profiles are applied. Stripping out embedded ICC profiles will colour manage the objects (images) in the system, but when the images pass outside the system they will not be colour managed any more. In this scenario, either they will have to be rendered as deviceColor by the numbers, without a definition of the colours their colourants should form, or a source ICC profile will have to be assigned by the following system/application.
I've been exporting keynote slides as png's to use in video presentations. The problem is that the png's are saved with colour profiles, which means if I export the images from diferent macs, or even the same mac but with a different monitor attached (therefore a diferent monitor colour profile active), the images have very noticeable colour variations.
I could be considered an unconditional bug in Keynote if it embedded the current monitor profile and not the system RGB colour working space profile (: Generic RGB Profile). If indeed Keynote embeds the current monitor profile, it could be considered an unconditional bug in your understanding if you start by stripping the source profiles. You should be doing a profile to profile conversion in order to get into the RGB colour working space you want in Photoshop.
Sorry, but it helps to have a basic understanding of media independent colour matching (even if the developers don't sometimes -:)).
/hh -
Acquire and save images at high frame rates
I am attempting to acquire and save images at a rate of 3000 fps for approximately 100 ms using a JAI 6740GE GigE camera, LabView 2011, and IMAQdx. I can acquire the images at the necessary rates, but am dropping images when I try to save them. The current test program I am working with contains a producer loop for acquiring the images, converting them into an array, and putting them into a queue, and a consumer loop to write the arrays to a TDMS file. Currently I can acquire and save the images at a rate of approximately 1200 fps before I begin losing a few frames. The code is attached below. I would appreciate any ideas to be able to save the images without dropping frames.
Attachments:
Trigger Image to AVI faster.vi 38 KBHi Rox,
How are you verifying that you are loosing the frames during the saving and not during the acquisition? Are you able to determine where you are dropping frames? Is it at the beginning, the end or randomly? Thank you!
Regards,
Kira T -
Scripting to replace a layer in a psd file and save as a tiff for multiple images in a sequence
I have over a hundred images, all the same size, that I need bring into photoshop as a designated layer, one at a time, flatten the image and save as a tiff file with a sequential number, then repeating the process. I have not used javascript before but it seems like it should work. I'm using CS5. Thanks
It is possible to do that via Scripting.
If you are unable to create such a Script maybe you should look up the chapter »Creating data-driven graphics« in the documentation. -
I have been searching high and low for this one. I have a vbscript that can successfully perform the function if one file is listed. It does a Wscript.echo on the results and if I run this via command using cscript, I can output to a text file
that way. However, I cannot seem to get it to work properly if I want it to search ALL the files in the folder. At one point, I was able to have it create the output file and appear as if it worked, but it never showed any results when the script
was executed and folder was scanned. So I am going back to the drawing board and starting from the beginning.
I also have a txt file that contains the list of string text entries I would like it to search for. Just for testing, I placed 4 lines of sample text and one single matching text in various target files and nothing comes back. The current script
I use for each file has been executed with a few hundred string text lines I want it to search against to well over one thousand. It might take awhile, but it works every time. The purpose is to let this run against various log files in a folder and
let it search. There is no deleting, moving, changing of either the target folder/files to run against, nor of the file that contains the strings to search for. It is a search (read) only function, going thru the entire contents of the folder and
when done, performs the loop function and onto the next file to repeat the process until all files are searched. When completed, instead of running a cscript to execute the script and outputting the results to text, I am trying to create that as part
of the overall script. Saving yet another step for me to do.
My current script is set to append to the same results file and will echo [name of file I am searching]: No errors found. Otherwise, the
output shows the filename and the string text that matched. Because the results append to it, I can only run the script against each file separately or create individual output names. I would rather not do that if I could include it all in one.
This would also free me from babysitting it and running each file script separately upon the other's completion. I can continue with my job and come back later and view the completed report all in one. So
if I could perform this on an entire folder, then I would want the entries to include the filename, the line number that the match occurred on in that file and the string text that was matched (each occurrence). I don't want the entire line to be listed
where the error was, just the match itself.
Example: (In the event this doesn't display correctly below, each match, it's corresponding filename and line number all go together on the same line. It somehow posted the example jumbled when I listed it)
File1.txt Line 54
Job terminated unexpectedly
File1.txt Line 58 Process not completed
File1.txt
Line 101 User input not provided
File1.txt
Line 105 Process not completed
File2.txt
No errors found
File3.txt
Line 35 No tape media found
File3.txt
Line 156 Bad surface media
File3.txt Line 188
Process terminated
Those are just random fake examples for this post.
This allows me to perform analysis on a set of files for various projects I am doing. Later on, when the entire search is completed, I can go back to the results file and look and see what files had items I wish to follow up on. Therefore, the
line number that each match was found on will allow me to see the big picture of what was going on when the entry was logged.
I actually import the results file into a spreadsheet, where further information is stored regarding each individual text string I am using. Very useful.
If you know how I can successfully achieve this in one script, please share. I have seen plenty of posts out there where people have requested all different aspects of it, but I have yet to see it all put together in one and work successfully.
Thanks for helping.I'm sorry. I was so consumed in locating the issue that I completely overlooked posting what exactly I was needing help with. I did have one created, but I came across one that seemed more organized than what I originally created. Later
on I would learn that I had an error in log location on my original script and therefore thought it wasn't working properly. Now that I am thinking that I am pretty close to achieving what I want with this one, I am just going to stick with it.
However, I could still use help on it. I am not sure what I did not set correctly or perhaps overlooking as a typing error that my very last line of this throws an "Expected Statement" error. If I end with End, then it still gives same
results.
So to give credit where I located this:
http://vbscriptwmi.uw.hu/ch12lev1sec7.html
I then adjusted it for what I was doing.
What this does does is it searches thru log files in a directory you specify when prompted. It looks for words that are contained in another file; objFile2, and outputs the results of all matching words in each of those log files to another file: errors.log
Once all files are scanned to the end, the objects are closed and then a message is echoed letting you know (whether there errors found or not), so you know the script has been completed.
What I had hoped to achieve was an output to the errors.log (when matches were found) the file name, the line number that match was located on in that file and what was the actual string text (not the whole line) that matched. That way, I can go directly
to each instance for particular events if further analysis is needed later on.
So I could use help on what statement should I be closing this with. What event, events or error did I overlook that I keep getting prompted for that. Any help would be appreciated.
Option Explicit
'Prompt user for the log file they want to search
Dim varLogPath
varLogPath = InputBox("Enter the complete path of the logs folder.")
'Create filesystem object
Dim oFSO
Set oFSO = WScript.CreateObject("Scripting.FileSystemObject")
'Creates the output file that will contain errors found during search
Dim oTSOut
Set oTSOut = oFSO.CreateTextFile("c:\Scripts\errors.log")
'Loop through each file in the folder
Dim oFile, varFoundNone
VarFoundNone = True
For Each oFile In oFSO.GetFolder(varLogPath).Files
'Verifies files scanned are log files
If LCase(Right(oFile.Name,3)) = "log" Then
'Open the log file
Dim oTS
oTS = oFSO.OpenTextFile(oFile.Path)
'Sets the file log that contains error list to look for
Dim oFile2
Set oFile2 = oFSO.OpenTextFile("c:\Scripts\livescan\lserrors.txt", ForReading)
'Begin reading each line of the textstream
Dim varLine
Do Until oTS.AtEndOfStream
varLine = oTS.ReadLine
Set objRegEx = CreateObject("VBScript.RegExp")
objRegEx.Global = True
Dim colMatches, strName, strText
Do Until oErrors.AtEndOfStream
strName = oFile2.ReadLine
objRegEx.Pattern = ".{0,}" & strName & ".{0,}\n"
Set colMatches = objRegEx.Execute(varLine)
If colMatches.Count > 0 Then
For Each strMatch in colMatches
strText = strText & strMatch.Value
WScript.Echo "Errors found."
oTSOut.WriteLine oFile.Name, varLine.Line, varLine
VarFoundNone = False
Next
End If
Loop
oTS.Close
oFile2.Close
oTSOut.Close
Exit Do
If VarFoundNone = True Then
WScript.Echo "No errors found."
Else
WScript.Echo "Errors found. Check logfile for more info."
End If
End if -
Bridge CS6 Script to Find Multiple Images in Multiple folders.
Is it possible to have a script to find multiple images within multiple folders that is on a external hard drive?
For instances I have a external hard drive assuming it's for a library of pictures.
Inside this hard drive has folders named as below
1-1000
1001-2000
2001-3000
3001-4000
If I had a perfect csv file for example that calls out for specific pictures for example 2, 10,1500 and 2000 (remember think big, it may be a larger list than this it could be hundreds or thousands of pictures); is there a script that would allow me to find these images and save a copy of them on to my desktop so that way I don't have to hunt for them in the old fashion way? I can read scripts but writing them is a different story.If you want to go with Batch I would recommend creating an Action of more or less these steps:
• set the resolution to the same as the background image’s
• change the image from Background Layer to regular Layer if necessary
• convert it to a Smart Object
• add a Drop Shadow Layer Style to the image (do not use Global Angle)
• place the background image (File > Place …)
• move it behind the image layer
• Image > Reveal All
• make Selection from that layer’s transparency (cmd-click its icon in the Layers Panel) and use Image > Crop
• select and transform the image layer to fit the intended position
This would naturally work out best if the images had the same size and proportions.
For the reflection on the floor duplicate the image, flip it vertically, move it in position and reduce its opacity to maybe 10%.
Realistically you may have to hide it partially behind the pillows, a Vector Mask would be an option. -
Anyone got a script to import multiple placed images into CS4? or is this possible in CS5?
and can we output multiple layers into a single PDF in illustrator? Or multiple layers into single JPEGS from illustrator with one command instead of individually saving out each page... would be a huge time saver for me.
Currently I output each completed layer individually and then right click those outputted jpegs in their output folder and choose "combine supported files into acrobat..." to make a single acrobat file..
I`d also like to be able to CTRL click multiple layers and go save as... only those layers get saved out...
And so adding something in the Save for PDF output dialogue box to save layers to multiple pages would be a helpful time saver..In CS 4 and CS 5 you can drag and drop fro m the finder or the Bridge, and I guess any other similar type viewer, multiple number of image files to a document. You can configure the bridge in such a way as to allow you to see the Bridge and your document at the same time for this very purpose.
If you just drag and drop the files are linked if you drag while holding the shift key then the files will be embedded.
ID and PS CS 5 have a minibridge which works the sam way but is an actually panel and will stay in the front.
I separate the images but they import one on top of another.
Maybe you are looking for
-
Hi there, I was wondering if anyone could help me sort out a problem with the Zen V Plus that I bought a couple of months ago. Today the battery ran out so I plugged it into my laptop and left it to charge. After?a few hours I checked how it was goin
-
TS1717 Apple mobile device failed to start
During installation of iTunes, error message: Apple mobile device failed to start and something about not having "privileges" Some ideas?
-
After killing the hptonectl.exe task i can no longer control the volume. Any suggestions or upgrades to the hptonectl program? Thanks Mark
-
Resizing temporary tablespace in oracle 8i
Please, I some questions on oracle 8i. 1. how do I know on oracle 8i if the tablespace X is the temporary tablespace? 2. I have someone that increase the size of the temporary tablespace, so I have to decrease it to its normal size, my question is wh
-
I have partitioned my tables, do I need to rebuild the indexes of the table
Hello, I have partition very huge tables, by using rage partition method. After that few queries taking more time than before. Does the old indexes needs to rebuild? Thanks