Continue a script in Photoshop

Hi
I need to write a script that export artboards as PSD then open these files in Photoshop in order to continue the processing.
So here´s basically the concept:
#target illustrator
...body of the code to be executed in Illustrator, concluding with the document.exportFile (...) method; //it´s perfect up here. It generates the PSD properly.
if (app.activeDocument.artboards.length == 1){ //if the Ai File had only one artboard then I know only 1 PSD file was exported. So I need to open this document and continue in Photoshop
...execute this first code in Photoshop.
else
if (app.activeDocument.artboards.length > 1){
...execute this second code inn Photoshop
The problem is. How it could change the target application in the middle of the script? (this case, inside an IF loop)?
I tried to read about BridgeTalk but perhaps I did not understand it right. Should I send the code portion as a "message" to Photoshop?? I´m having no luck doing this
Best Regards
Gustavo.

Hi Muppet
I´m trying to read the documentation and chapter about BridgeTalk but it´s
unclear for me. Could you help me a little more?
Here´s an example of function that should be sent as message to Photoshop
execute:
function psExecute (arg) { //the argument will be a File stored in a variable called "f".
    photoshop.open (arg);       
    var doc = app.activeDocument;
    doc.flatten();
    doc.convertProfile ("sRGB IEC61966-2.1", Intent.RELATIVECOLORIMETRIC , true, true);
    doc.resizeImage (UnitValue(largura, "px"), UnitValue(altura, "px"), 300, ResampleMethod.BICUBIC);
    var opJPG = new JPEGSaveOptions();
    opJPG.embedColorProfile = true;
    opJPG.formatOptions = FormatOptions.STANDARDBASELINE;
    opJPG.matte = MatteType.WHITE;
    opJPG.quality = 12;
    var outputPS = new File ("~/Desktop/File.jpg");       
    doc.saveAs (outputPS, opJPG, true, Extension.LOWERCASE);       
Now here´s what I´ve already done with BridgeTalk:
var f = new File ("~/Desktop/F1.psd");
var messenger = new BridgeTalk();
messenger.target = "photoshop-60.064";
//messenger.body ?????? Here´s the problem. How could I use the toSource method passing the psExecute (f)??
messenger.send();
Gustavo.
Message was edited by: Gustavo Del Vechio
Message was edited by: Gustavo Del Vechio

Similar Messages

  • How do you script in Photoshop?

    I've asked everywhere but here. Please where is there an option to script in Photoshop. Im tryin gto make the hands on a clock go around, which I have the script for it, I just need to use it in Photoshop. Somebody please direct me or help me.

    There is a folder called 'Scripting' in your PS app installation directory. It's full of docs and examples. Start there.
    -X

  • I just continued my trial on photoshop and need to find my serial number in order to continue. Where can I find that?

    I just continued my trial on photoshop and need to find my serial number in order to continue. Where can I find that?

    Creative Cloud products don't use serial numbers.  Simply log-in with your Adobe ID (email) and password.
    Nancy O.

  • Where is the tool script on photoshop ?

    Where is the tool "script" in photoshop. I had this in an old version.

    I am not familiar with a Photoshop Script named "tool" so I assume this is not part of the default installation.
    So you probably need to copy it into the appropriate Scripts-folder.

  • How do i transform a layer with maintain aspect ratio through scripting in Photoshop?

    Hi,
         How do i transform a layer with maintain aspect ratio through scripting in Photoshop? I am expecting your reply.
    thanks,
    Rajiv.s

    I don't think your talking apples to apples.  First I do not know of any Maintain Aspect Ratio icon in Photoshop. The only icon I think associated with transform is the anchor point icon in the option bar for transform. I think you may referring to the constrain check box in the image size dialog which you can check when resample is checked. Image size effect all layers in the document and the documents canvas size. The document canvas size will be changed to the values in the images size dialog and all layers will be transformed by percentage the canvas was changes while maintaining the layers position over the canvas and the layers I think may be cropped so only pixels over the canvas remain.
    I do not know if you know that layers can be any size and have aspect ratios different then the documents canvas.
    In your case it sounds like your describing a template that has a canvas size that is 2000px wide be 3000px high a 2:3 portrait aspect ratio.  Your image file has a landscape aspect. If you place that image into your template place would by default transform the image so the image would fit within the 2000px by 3000px canvas size there would be a white border top and bottom.  You could transform that smart object layer to it actual pixels size activeDocument.activeLayer.resize(100,100, AnchorPosition.MIDDLECENTER); then calculate the size you want to transform its height to. By retrieving the canvas size and the layers boundaries. Divide the canvas height pixel size by the layers pixel height size should give you the percentage you need to use. Make sure you set the ruler units to pixels so your working with pixel values for the canvas and layer size values. The resulting layer will be larger then canvas size keeping the anchor point centered will result in the canvas size masking off both sides.  In effect cropping you landscape to a portrait.  Note cropping a image from one orientation to the other changes the composition drastically.
    If your trying to make a composit like collage you may want to look at my Photoshop Collage Toolkit it will fit images to fill a 2000px by 3000px area http://www.mouseprints.net/old/dpr/PhotoCollageToolkit.html
    You could also do centered 2:3 crop that is resized to a 3000px

  • Problème erreur scripts / tracé PHOTOSHOP

    Bonjour,
    Je souhaite automatiser des action en passant par les scripts de PHOTOSHOP
    Le but étant d'enlever le fond d'une image déjà détourée avec le tracé existant.
    Hors, le script s'arrête : "l'objet tracé "nom" n'est pas disponible pour l'instant"
    Si vous avez une solution, cela m'éviterai cette manipulation pour plus de 1000 images du dossier.
    Bonne journée!
    Merci
    Pierre-Olivier

    Y a-t'il beaucoup de noms différents?
    à ce moment, faire différentes actions pour chaque nom, et les rejouer jusqu'à ce que toute la
    Vous faites des traitements par lots via Bridge?
    Je me demande s'il y a moyen de trouver le nom des tracés dans MacOS.
    Ou s'il faudrait un script (comme javascript, applescript ou visualbasic) qui sélectionnerait les tracés quel que soient leur nom.
    Je vais regarder dans le forum de scripting.
    Trouvé ceci : http://forums.adobe.com/message/3941737#3941737

  • Scripting for Photoshop - Warm Up ?

    Hi, I've been looking though the Photoshop Scripting guide, and looking for any tutorials to get warmed up with scripting for Photoshop, but I can't find any ?

    https://www.google.com/search?num=50&newwindow=1&safe=off&site=&source=hp&q=photoshop+scri pting+tutorial&oq=photoshop+scripting+tutorial&gs_l=hp.13..0l2j0i30j0i5i30l2j0i8i30l5.4462 8.60489.0.71161.28.28.0.0.0.0.92.1562.28.28.0.eqrwrth.1.0.0...1.1.16.hp.HVzjgJ5O9iw

  • Cannot use new fill pattern scripts for Photoshop CC 2014.2

    I have installed Photoshop CC 2014.2 (2014.2.0 Release), but am unable to get the new Fill pattern scripts to work or even show up in the UI. Namely, I am referring to the Flame, Picture Frame, and Tree scripted patterns described here: https://www.adobe.com/technology/projects/DecoScriptedPatternsInPhotoshop.html
    This is what my Fill dialog looks like:
    I have confirmed that the corresponding presets exist in the Photoshop CC 2014 > Presets > Deco folder:
    I have tried resetting Photoshop's preferences; and while everything was reset, the missing presets still failed to appear.

    If you are talking about CC 2014 and not CC, have you updated to
    Adobe Photoshop Version: 2014.2.1 20141014.r.257 2014/10/14:23:59:59 CL 987299  x64?
    (First line of File > System Info)
    Gene

  • Flash scripting in photoshop elements.

    Photoshop elements 7 running a flash script.
    Everything needed to do this is on the adobe
    labs page.
    Click the images to see bigger views.

    Can you please more details on script creation and execution process in PSE?

  • Script error - "photoshop is undefined"

    I have been having problems working from Bridge CC to Photoshop CC and also Lightroom to Photoshop CC on my Mac 10.9.2.
    These are the scripting errors I have been getting:
    1. Trying to open a DNG file from Lightroom into Photoshop
    SCRIPT EXECUTION ERROR Sat Apr 19 14:54:28 2014
    Error in Line 92: photoshop.openFromLightroom ( file, /* required. path to file to open */ photoshop is undefined
    2. Trying to open images from Bridge into Photoshop
    SCRIPT EXECUTION ERROR Sat May 10 15:13:48 2014
    Error in Line 1: photoshop.loadFilesIntoStack ([new File ("~/Pictures/2014.05.10_001/img_001.jpg"), new File ("~/Pictures/2014.05.10_001/img_002.jpg"), new File ("~/Pictures/2014.05.10_001/img_003.jpg")]); photoshop is undefined
    I can open a DNG file from Lightroom to Photoshop as a smart object, but it will not do a simple file transfer.
    I have also flattened my Mac, reinstalled the operating system, reinstalled the Adobe CC tools and it still does not work.
    I have also checked permissions on appropriate folders and files. It is like my old Windows days where an application path of a program is not correctly defined in the Windows registry.
    Help would be appreciated. Right now I have three Adobe products that have little integration between them.
    Thanks
    Randy

    OK, I found the solution to my problem. This is weird.
    I have struggled getting the Adobe products to work together. I have flattened my Mac system twice, reinstalled Adobe products and it never fixed my problem. I was a rare instance in the Adobe Forum where Adobe products would not work together.
    To solve the problem, I decided to flatten my hard drive again and reinstall Adobe products again. Lightroom CC, Photoshop CC and Bridge CC. Finally this time the Adobe products all of a sudden started working together.
    Next, when I plugged my main external hard drive back in, the Adobe products quit working again. I tried plugging another external hard drive in and Adobe products worked OK. So I figured that the one hard drive was causing the problem.
    Here is why it was causing the problem:
    Apple Mac OS X has a folder called LIBRARY at the system level that contains all the support files needed for the operating system.
    Apple Mac OS X also has a folder called LIBRARY at the user level that contains all of the support files needed for user installed applications.
    I has an external USB drive that I named LIBRARY. Whenever I plugged that in, Adobe saw it and for some reason thought it was an official LIBRARY drive that had information that Adobe needed. Needless to say, there was no data Adobe could use. Adobe was faked out by the name of an attached USB drive and crapped out when Adobe products needed to integrate.
    So I renamed the USB drive to LIBRARY MAIN and all the Adobe products started working together.
    So the moral of the story is that either users need to quit naming external drives to LIBRARY or Adobe needs to quit looking at external hard drives for needed runtime information.
    I hope this helps.
    Randy

  • How do I start the script for Photoshop CS6 in Bridge CS6 image processor ?

    I am new to Bridge and I am lookiing for a way to batch process images. I opened 'preferences' and did not find Photoshop CS6 under the script list. How do I open and run the image processor? Thanks for any help!!

    I have clicked on 'tools' within Bridge but there is no 'Photoshop' in the drop-down menu.
    Misread your post a bit and see you want the image processor, however, this should be in the same location as the Batch option. If you don't have Photoshop in that list it means the start up script is not active or not installed properly.
    First check Bridge preferences / Start up scripts and see if Photoshop is listed inhere and has a checkmark in front. If no checkmark then set it to on, restart Bridge and try again. If no Start upScript at all first try restart Bridge holding down option key (Mac) or ctrl (Win) and choose reset preferences.
    If still no luck try a reinstall of PSCS6 to also reinstall Bridge again. (you first have to uninstall PSCS6, be sure to have a back up of custom settings etc).

  • How to run a script without Photoshop's GUI or...

    within GUI, but without animation of every command in the script?
    I need to process huge number of pictures - animation makes serious impact on performance...
    Thanx all.

    In VB/VB.Net you can use the visible property and make Photoshop invisible. I don't think it appreciably speeds up the processing but it does seem to help some.
    The downside is if your application has some kind of issue and doesn't make Photoshop visible again before quitting. At least in older versions (pre CS3) I experienced Photoshop not showing itself even after stopping and restarting, including re-booting etc. You had to run a program that made it visible again. At least that was my experience.
    I don't know if that is still true in CS2/CS3/CS4 however and may not be.
    While I haven't done any highly controlled bench marking, I have found that in CS4 (at least the original public release of it), VB.net seemed to outperform java script doing the same thing by about 33%. I did my best to make both as efficient as possible and I just couldn't get the java script stuff to operate as fast. I was surprised. Again, it wasn't as controlled as it should have been, but it was at least consistent.
    Another thing that should make the execution more efficient is to make sure the layers palette is either not shown or is collapsed. That actually seems to speed things up quite a bit. The program doesn't have to show all the changes happening in that palette. Of course all pallets that change upon execution of commands should also be closed or collapsed. This should be done even if you are going to minimize and/or hide photoshop too. I'm of the opinion (via observation) that the program knows when these palettes don't need to be updated and so they must avoid doing the code behind the display of the change.
    Regards
    George Smith

  • ExtendToolscript opens when I call script from photoshop

    Hey,
    I asked this question over in general discussions by mistake so I though I would re-ask it here.
    I have a Javascript that I have written that builds a interface of buttons in organised groups based on the contents of certain folders. Everything works fine but when you call it from photoshop and extendtoolscript isn't running it always opens it up. I have written a lot of scripts with interfaces and I have never had this problem. Its not a huge problem for me as I usually have this program open anyway but I intend to have a team of people using this script so if I could stop it somehow it would be much better.
    Has anyone experienced this before? Or perhaps knows of functions that cause extendscript to open?
    I can't see anything unusual in the script...
    Any help would be appreciated!
    Thanks,
    Mark
    var strtRulerUnits = app.preferences.rulerUnits;
    var strtTypeUnits = app.preferences.typeUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    app.preferences.typeUnits = TypeUnits.PIXELS;
    var templatepath = "~/Desktop/BANNERS/";
    var bannerfile = ""
    var docRef = app.activeDocument;
    var fileArray = new Array();
                    var sourceFolder = Folder (templatepath + "MAIN/");
                    var extRE = /\.(?:png|gif|jpg|bmp|tif|psd)$/i;
                    // get all files in source folder
                    var docs = sourceFolder.getFiles();
                    var len = docs.length;
                    for (var i = 0; i < len; i++) {
                                    var doc = docs[i];
                                    // only match files (not folders)
                                    if (doc instanceof File) {
                                                    // store all recognized files into an array
                                                    var docName = doc.name;
                                                    if (docName.match(extRE)) {
                                                                    fileArray.push(doc);
                var w = new Window ("dialog", "Choose a Banner");
                w.preferredSize = [400, 100];
                w.orientation = 'row';
                w.alignChildren = "left"
                w.alignChildren = [ "fill", "fill"];
                w.btnPnl = w.add('panel', undefined, 'MAIN');
                w.btnPnl.btn = w.add ("group");
                w.btnPnl.btn.alignChildren = "left"
                var buttonarray = new Array ();
                var key = {};
                for (var i = 0; i < fileArray.length ; i++) {
                    var delimeter = '/';
                    var string = String (fileArray[i]);
                    var splitted = string.split(delimeter);
                    var thelength = ((splitted.length) - 1);
                    var bannername = splitted[thelength];
                    var delimeter = '.';
                    var splitted = bannername.split(delimeter);
                    var bannername = splitted[0];
                    var checkdelim = "%20";
                    var checkthat =  bannername.indexOf(checkdelim);
                    if (checkthat == "-1") {}
                    else {
                    var delimeter = '%20';
                    var splitted = bannername.split(delimeter);
                    var counter = 0;
                    while (counter < splitted.length){
                    if (counter == 0){
                    var bannername = (splitted[counter] + " ");   
                    else if (counter == ((splitted.length) - 1)){
                    var bannername = (bannername + splitted[counter]);
                    else{
                    var bannername = (bannername + splitted[counter] + " ");
                    var counter = (counter + 1);
                if (fileArray.length > 6){
                        var divider = 2
                    else{
                        var divider = 1
                    var remainder = (i % divider);
                    if (remainder == 0){ 
                    w.btnPnl.btn = w.btnPnl.add ("group");
                    w.btnPnl.btn.alignChildren = "left"
                    } else {
                    //x is not a multiple of y
                    key = (String (fileArray[i]));
                    w[key] = w.btnPnl.btn.add("button", undefined ,bannername );
                    w[key].alignment = 'left';
                    buttonarray.push(w[key]);
                    w.btnPnl.btn.addEventListener('click', button_pressed);
                    function button_pressed (e)
                   if (e.target.type == "button")
                    $.writeln (e.target.text + " from panel " + e.target.parent.text);
                    w.close()
                    var buttonname = e.target.text;
                    var checkdelim = " ";
                    var checkthat = buttonname.indexOf(checkdelim);
                    if (checkthat == "-1") {}
                    else {
                    var delimeter = ' ';
                    var splitted = buttonname.split(delimeter);
                    var counter = 0;
                    while (counter < splitted.length){
                    if (counter == 0){
                    var buttonname = (splitted[counter] + "%20");   
                    else if (counter == ((splitted.length) - 1)){
                    var buttonname = (buttonname + splitted[counter]);
                    else{
                    var buttonname = (buttonname + splitted[counter] + "%20");
                    var counter = (counter + 1);
                    bannerfile = new File (templatepath + "MAIN/" + buttonname + '.png');
    var fileArrayneon = new Array();
                    var sourceFolder = Folder (templatepath + "NEON/");
                    var extRE = /\.(?:png|gif|jpg|bmp|tif|psd)$/i;
                    // get all files in source folder
                    var docs = sourceFolder.getFiles();
                    var len = docs.length;
                    for (var i = 0; i < len; i++) {
                                    var doc = docs[i];
                                    // only match files (not folders)
                                    if (doc instanceof File) {
                                                    // store all recognized files into an array
                                                    var docName = doc.name;
                                                    if (docName.match(extRE)) {
                                                                    fileArrayneon.push(doc);
                w.btnPnl = w.add('panel', undefined, 'NEON');
                w.btnPnl.btn = w.add ("group");
                var buttonarray = new Array ();
                var key = {};
                for (var i = 0; i < fileArrayneon.length ; i++) {
                    var delimeter = '/';
                    var string = String (fileArrayneon[i]);
                    var splitted = string.split(delimeter);
                    var thelength = ((splitted.length) - 1);
                    var bannername = splitted[thelength];
                    var delimeter = '.';
                    var splitted = bannername.split(delimeter);
                    var bannername = splitted[0];
                    var checkdelim = "%20";
                    var checkthat =  bannername.indexOf(checkdelim);
                    if (checkthat == "-1") {}
                    else {
                    var delimeter = '%20';
                    var splitted = bannername.split(delimeter);
                    var counter = 0;
                    while (counter < splitted.length){
                    if (counter == 0){
                    var bannername = (splitted[counter] + " ");   
                    else if (counter == ((splitted.length) - 1)){
                    var bannername = (bannername + splitted[counter]);
                    else{
                    var bannername = (bannername + splitted[counter] + " ");
                    var counter = (counter + 1);
                if (fileArrayneon.length > 6){
                        var divider = 2
                    else{
                        var divider = 1
                    var remainder = (i % divider);
                    if (remainder == 0){ 
                    w.btnPnl.btn = w.btnPnl.add ("group");
                    w.btnPnl.btn.alignChildren = "left"
                    } else {
                    //x is not a multiple of y
                    key = (String (fileArrayneon[i]));
                    w[key] = w.btnPnl.btn.add("button", undefined ,bannername );
                    w[key].alignment = 'left';
                    buttonarray.push(w[key]);
                    w.btnPnl.btn.addEventListener('click', button_pressed);
                    function button_pressed (e)
                   if (e.target.type == "button")
                    $.writeln (e.target.text + " from panel " + e.target.parent.text);
                    w.close()
                    var buttonname = e.target.text;
                    var checkdelim = " ";
                    var checkthat = buttonname.indexOf(checkdelim);
                    if (checkthat == "-1") {}
                    else {
                    var delimeter = ' ';
                    var splitted = buttonname.split(delimeter);
                    var counter = 0;
                    while (counter < splitted.length){
                    if (counter == 0){
                    var buttonname = (splitted[counter] + "%20");   
                    else if (counter == ((splitted.length) - 1)){
                    var buttonname = (buttonname + splitted[counter]);
                    else{
                    var buttonname = (buttonname + splitted[counter] + "%20");
                    var counter = (counter + 1);
                    bannerfile = new File (templatepath + "NEON/" + buttonname + '.png');
    var fileArray180 = new Array();
                    var sourceFolder = Folder (templatepath + "180/");
                    var extRE = /\.(?:png|gif|jpg|bmp|tif|psd)$/i;
                    // get all files in source folder
                    var docs = sourceFolder.getFiles();
                    var len = docs.length;
                    for (var i = 0; i < len; i++) {
                                    var doc = docs[i];
                                    // only match files (not folders)
                                    if (doc instanceof File) {
                                                    // store all recognized files into an array
                                                    var docName = doc.name;
                                                    if (docName.match(extRE)) {
                                                                    fileArray180.push(doc);
                w.btnPnl = w.add('panel', undefined, '180');
                w.btnPnl.btn = w.add ("group");
                var buttonarray = new Array ();
                var key = {};
                for (var i = 0; i < fileArray180.length ; i++) {
                    var delimeter = '/';
                    var string = String (fileArray180[i]);
                    var splitted = string.split(delimeter);
                    var thelength = ((splitted.length) - 1);
                    var bannername = splitted[thelength];
                    var delimeter = '.';
                    var splitted = bannername.split(delimeter);
                    var bannername = splitted[0];
                    var checkdelim = "%20";
                    var checkthat =  bannername.indexOf(checkdelim);
                    if (checkthat == "-1") {}
                    else {
                    var delimeter = '%20';
                    var splitted = bannername.split(delimeter);
                    var counter = 0;
                    while (counter < splitted.length){
                    if (counter == 0){
                    var bannername = (splitted[counter] + " ");   
                    else if (counter == ((splitted.length) - 1)){
                    var bannername = (bannername + splitted[counter]);
                    else{
                    var bannername = (bannername + splitted[counter] + " ");
                    var counter = (counter + 1);
                   if (fileArray180.length > 6){
                        var divider = 2
                    else{
                        var divider = 1
                    var remainder = (i % divider);
                    if (remainder == 0){ 
                    w.btnPnl.btn = w.btnPnl.add ("group");
                    w.btnPnl.btn.alignChildren = "left"
                    } else {
                    //x is not a multiple of y
                    key = (String (fileArray180[i]));
                    w[key] = w.btnPnl.btn.add("button", undefined ,bannername );
                    w[key].alignment = 'left';
                    buttonarray.push(w[key]);
                    w.btnPnl.btn.addEventListener('click', button_pressed);
                    function button_pressed (e)
                   if (e.target.type == "button")
                    $.writeln (e.target.text + " from panel " + e.target.parent.text);
                    w.close()
                    var buttonname = e.target.text;
                    var checkdelim = " ";
                    var checkthat = buttonname.indexOf(checkdelim);
                    if (checkthat == "-1") {}
                    else {
                    var delimeter = ' ';
                    var splitted = buttonname.split(delimeter);
                    var counter = 0;
                    while (counter < splitted.length){
                    if (counter == 0){
                    var buttonname = (splitted[counter] + "%20");   
                    else if (counter == ((splitted.length) - 1)){
                    var buttonname = (buttonname + splitted[counter]);
                    else{
                    var buttonname = (buttonname + splitted[counter] + "%20");
                    var counter = (counter + 1);
                    bannerfile = new File (templatepath + "180/" + buttonname + '.png');
    var fileArraymisc = new Array();
                    var sourceFolder = Folder (templatepath + "MISC/");
                    var extRE = /\.(?:png|gif|jpg|bmp|tif|psd)$/i;
                    // get all files in source folder
                    var docs = sourceFolder.getFiles();
                    var len = docs.length;
                    for (var i = 0; i < len; i++) {
                                    var doc = docs[i];
                                    // only match files (not folders)
                                    if (doc instanceof File) {
                                                    // store all recognized files into an array
                                                    var docName = doc.name;
                                                    if (docName.match(extRE)) {
                                                                    fileArraymisc.push(doc);
                w.btnPnl = w.add('panel', undefined, 'MISC');
                w.btnPnl.btn = w.add ("group");
                var buttonarray = new Array ();
                var key = {};
                for (var i = 0; i < fileArraymisc.length ; i++) {
                    var delimeter = '/';
                    var string = String (fileArraymisc[i]);
                    var splitted = string.split(delimeter);
                    var thelength = ((splitted.length) - 1);
                    var bannername = splitted[thelength];
                    var delimeter = '.';
                    var splitted = bannername.split(delimeter);
                    var bannername = splitted[0];
                    var checkdelim = "%20";
                    var checkthat =  bannername.indexOf(checkdelim);
                    if (checkthat == "-1") {}
                    else {
                    var delimeter = '%20';
                    var splitted = bannername.split(delimeter);
                    var counter = 0;
                    while (counter < splitted.length){
                    if (counter == 0){
                    var bannername = (splitted[counter] + " ");   
                    else if (counter == ((splitted.length) - 1)){
                    var bannername = (bannername + splitted[counter]);
                    else{
                    var bannername = (bannername + splitted[counter] + " ");
                    var counter = (counter + 1);
                    if (fileArraymisc.length > 6){
                        var divider = 2
                    else{
                        var divider = 1
                    var remainder = (i % divider);
                    if (remainder == 0){ 
                    w.btnPnl.btn = w.btnPnl.add ("group");
                    w.btnPnl.btn.alignChildren = "left"
                    } else {
                    //x is not a multiple of y
                    key = (String (fileArraymisc[i]));
                    w[key] = w.btnPnl.btn.add("button", undefined ,bannername );
                    w[key].alignment = 'left';
                    buttonarray.push(w[key]);
                    w.btnPnl.btn.addEventListener('click', button_pressed);
                    function button_pressed (e)
                   if (e.target.type == "button")
                    $.writeln (e.target.text + " from panel " + e.target.parent.text);
                    w.close()
                    var buttonname = e.target.text;
                    var checkdelim = " ";
                    var checkthat = buttonname.indexOf(checkdelim);
                    if (checkthat == "-1") {}
                    else {
                    var delimeter = ' ';
                    var splitted = buttonname.split(delimeter);
                    var counter = 0;
                    while (counter < splitted.length){
                    if (counter == 0){
                    var buttonname = (splitted[counter] + "%20");   
                    else if (counter == ((splitted.length) - 1)){
                    var buttonname = (buttonname + splitted[counter]);
                    else{
                    var buttonname = (buttonname + splitted[counter] + "%20");
                    var counter = (counter + 1);
                    bannerfile = new File (templatepath + "MISC/" + buttonname + '.png');
    w.show();
    if (bannerfile == ""){}
    else{
    var targetDocumentName =  docRef.name;
    var tempfile = app.open (bannerfile);
    var sourceDocumentName = app.activeDocument.name;
    var thewidth = tempfile.width;
    var theheight  = tempfile.height;
    app.activeDocument = docRef;
    docRef.resizeImage (null, theheight, null, ResampleMethod.BICUBIC);
    if ((String(thewidth)) == (String(docRef.width))){
    var thelayer = docRef.activeLayer;
    copyLayers(sourceDocumentName, targetDocumentName );
    docRef.activeLayer = thelayer;
    else {
    alert ("Document width Incorrect")  
    docRef.activeLayer.name = "main";
    var thelayer = docRef.activeLayer;
    docRef.resizeCanvas (thewidth, null, AnchorPosition.BOTTOMCENTER);
    copyLayers(sourceDocumentName, targetDocumentName );
    docRef.activeLayer = thelayer;
      imageView ("FtOn");
    function copyLayers(sourceDocumentName, targetDocumentName) {
      var sourceDoc = app.documents[sourceDocumentName];
      var targetDoc = app.documents[targetDocumentName];
      var sourceLayer, targetLayer, sourceGroup;
      if (app.activeDocument != sourceDoc) {
        app.activeDocument = sourceDoc;
    var thelayer = tempfile.layers[0];
    var layersToCopy = thelayer.name;
      if ( typeof layersToCopy === 'string' ) {
        sourceGroup = tempfile.layers[0];
        targetLayer = sourceGroup.duplicate( targetDoc, ElementPlacement.PLACEATBEGINNING )
      else if ( Object.prototype.toString.call( layersToCopy ) === '[object Array]' ) {
        for (var i = 0; i < layersToCopy.length; i++) {
          sourceLayer = sourceDoc.artLayers.getByName( layersToCopy[i] );
          targetLayer = sourceLayer.duplicate( targetDoc, ElementPlacement.PLACEATBEGINNING );
    tempfile.close(SaveOptions.DONOTSAVECHANGES);
    function imageView (view) {
        desc= new ActionDescriptor();
            ref = new ActionReference();
          if (view.length < 5){
             var viewID = charIDToTypeID( view );
          }else{
             var viewID = stringIDToTypeID( view );
          ref.putEnumerated( charIDToTypeID( "Mn  " ), charIDToTypeID( "MnIt" ), viewID );
        desc.putReference( charIDToTypeID( "null" ), ref );
       executeAction( charIDToTypeID( "slct" ), desc, DialogModes.NO );

    $.writeln ( ) writes the specified text to the JavaScript Console in ExtendScript Toolkit.
    You probably need to comment out the 4 occurences of the following line, apparently used for debugging purposes:
    $.writeln (e.target.text + " from panel " + e.target.parent.text);

  • How to get diacriptic script in Photoshop

    I have a name ending with an e capped by a forward slash on top of it, in Word you find that diacriptic script under symbols
    but I cannot seem to find this when doing captions. I am ever so green with Photoshop, please bear with me.
    klokkestoel

    Which operating system and version of photoshop elements are you using?
    Is that when adding captions in the photoshop elements organizer?
    Do you mean an acute accent symbol like below?

  • Bridge batch processing script for Photoshop stops after ten mins

    I have a javacript to help batch process collections of images in Bridge by sending them (in layers) to Photoshop CS5. It works perfectly, except it stops running after about ten minutes (around 6-10 images) so that I have to keep restarting the script. This behaviour has only started since the script was installed in the Bridge startup folder so that it could be started from the (right click) menu. The script does not seem to time out when run via ExtendToolkit.
    Does anyone know why this is happening?

    Thanks again Paul. Can I ask you where the best place to insert that would be? The script is below - I'm sure you'll recognise it :6).
    I've also been wondering if its possible to alter the script so that the files in bridge are opened in PS as Smart Objects (in layers)? There is a script 'Open as Smart Object in Layers' but I haven't been able integrate it into your fantastic script.
    #target bridge
    if( BridgeTalk.appName == "bridge" ) {
    processDocs = new MenuElement("command", "Process selected docs", "at the end of Thumbnail");
    processDocs.onSelect = function () {
    var sels = app.document.selections;
    var selectedFiles = new Array();
    for(var a in sels){
        selectedFiles.push(sels[a].spec);
          if(selectedFiles.length> 1){
               var bt = new BridgeTalk;
               bt.target = "photoshop";
               var myScript = ("var ftn = " + psRemote.toSource() + "; ftn("+selectedFiles.toSource()+");");
               bt.body = myScript;
               bt.send(5);
    function psRemote(selectedFiles){
    app.bringToFront();
    for(var f in selectedFiles){
    var thisDoc = open(File(selectedFiles[f]));
    /*run an action if required */
    /* app.doAction("atn", "atnSet"); */
    /*script listener code goes here...
      You will need to remove the //===== lines or the script will fail 
    /* end script listener code */
          var saveFile = new File('~/desktop/'+(new Date().getTime().toString())+'.psd');
          app.activeDocument.saveAs(saveFile);
          app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);

Maybe you are looking for

  • Mail problems since upgrading to security 2015-002

    Since upgrading to security 2015-002 I cannot send or receive emails. I receive an email alert saying the default ports timed out. Prior to the upgrade everything was fine. At present I am deleting all my email setting and reinstalling them but this

  • Weird problem during synchronization !!!??

    Hi all I came accross a weird problem during synchronization. I am into customizing MAM2.5, and in testing phase. I created 600 local measurement documents and tried to sync. Nearly half of the documents got successfully posted at the back end and go

  • What is Over Under Absorption means?

    Hi guyz, When I'm running Cost Center Actual/Plan/Variance Reporting, there is a field that is called Over/Under Absorption. What does it mean by Over/Under Absorption? Thanks guyz

  • Word for mac won't show doc in print preview and prints blank page.

    I have a document from layoutready.com that I have been editing and it is a .doc file originally and won't show up. I've tried saving it as .docx and still nothing. Also, when I create a new document and put in a shape or a text box, it won't show up

  • DBAdapter called by EJB

    Hello, I'm trying to call DBAdapter used by OSB 10gR3 in WLS by a SLSB. 1) I get connection factory: # Context ic = new InitialContext(); # cf = (DBConnectionFactory) ic.lookup("eis/DB/logdb"); 2) read interaction specs supported: # ResourceAdapterMe