Illustrator script to open file in Photoshop

The Bridge SDK has a script to open a selected file in Photoshop.
Can this  be done from Illustrator instead?
It seems that the cross-dom function open() should work in either an illustrator or bridge script, yet the following does NOT work in Illustrator.
Fresh from the Bridge 5.1 SDK, it doesn't work in Bridge either, but that's for a different forum.
var t = app.activeDocument.fullName;
Photoshop.open(new File(t));
It provides me with Error 2: Photoshop is undefined.
So, any ideas on how to make this work?
This is all leading up to the real problem, which is to create a 150dpi jpg file, which Illustrator won't do.
Thanks All.
--Alex

There are several ways in which you could get you output *jpeg to 72 dpi at a given set of dimensions… On way would be to scale the whole art in AI before exporting it… Up to you if you save this change or not… You can have PS open the image and alter the resolution after exporting… Or on the mac you could use some utility like the shell SIPS which you also have AppleScript access to via Image Events scripting… Anyhows here is a very basic example of how th pass a file object to PS using the bridgetalk messaging system… The Adobe way of doing it so to speak… I included a filp just so's you could see the changes made… Have fun…
#target illustrator
var aiFile = File( '~/Desktop/zdfb.jpg' );
var psScript = 'app.displayDialogs = DialogModes.NO;';
psScript += 'app.open(' + aiFile.toSource() + ');';
psScript += 'app.activeDocument.resizeImage( undefined,undefined,72,ResampleMethod.NONE);';
psScript += 'app.activeDocument.flipCanvas( Direction.HORIZONTAL );';
psScript += 'app.activeDocument.close( SaveOptions.SAVECHANGES );';
psScript += 'app.displayDialogs = DialogModes.ALL;';
//$.writeln( psScript );
btMessaging( 'photoshop',psScript );
function btMessaging( targetApp, script ) {
          var bt = new BridgeTalk();
          bt.target = targetApp;
          bt.body = script;
          bt.onResult = function( inBT ) { alert( 'Done…' ) };
          bt.onError = function( inBT ) { alert( 'NOT Done…' ) };
          bt.send( 20 );
There are numerous ways in which you can construct the script 'string' contents on the fly but you get the general idea…

Similar Messages

  • Adobe creative suite cs5: unable to open files in photoshop. unable to drag objects on illustrator..

    Adobe creative suite cs5: unable to drag objects on illustrator or indesign. unable to open files in photoshop, brush doesnt work in photoshop.
    In the past I uninstalled adobe creative suite cs5 from my laptop, used the adobe creative cloud cleanup tool, restarted and then reinstalled the programs and everything worked again for about a week. Now everything has gone back to the way it was again and this time the uninstalling and reinstalling isnt helping.
    Any ideas?
    Im pretty desperate!!
    Thanks
    Alisa

    Hi Alisa
    I'm having exactly the same problem. Uninstalled CS4 and reinstalled the 30 day trial of the Creative Cloud and it's stil having the same glitches, not opening in photoshop and not being able to drag/move objects in Illustrator or inDesign.
    Did you find a solution to this problem?
    Thanks
    Jenny

  • Going crazy. Yosemite CS 6 Illustrator will not open files!!!

    Help. I have tried many numerous things but to no avail. uninstall, adobe clean, re-install, delete prefs...Cannot figure out why Illustrator doesn't open files. All the other CS 6 programs seem fine. ???

    Sorry Larry! I'll try to be more clear.
    Basically, when I create a new CMYK document in Illustrator I am having issues saving it as a cmyk pdf file even though I am using the using the Press Quality and PDFX-1a presets. Normally, those settings would create a CMYK pdf file but when I view the color modes in Acrobat and Photoshop those programs are telling me they are in RGB formats.
    I have been viewing the color mode in Acrobat Pro by going to print>Advanced. Under the Color Management section on the right the color Profile reads Working RGB: Adobe RGB (1998). See screenshot below.
    When I try to open the .pdf files in Photoshop to check the color mode, the mode is showing up as RGB as well. See screenshot below.
    Hopefully that makes more sense. If you need any other information or clarification, just hollar! Thanks so much for taking the time to help!

  • When I try to open an image by double clicking on it in Bridge, I get a message telling me to log in to Creative Cloud.  I am running CS6, and the default should be to open files in Photoshop 6 or in Adobe Raw (if it's a Raw file).  I don't want to log in

    When I try to open an image by double clicking on it in Bridge, I get a message telling me to log in to Creative Cloud.  I am running CS6, and the default should be to open files in Photoshop 6 or in Adobe Raw (if it's a Raw file).  I don't want to log into CC since I am not a subscriber, and this means that I have to work around, and go  back to Bridge, and tell it to open the file in Adobe RAW.  However, this does not work for older psd files which for some reason cannot be opened in RAW.  How do I return to the process of simply allowing RAW files to open automatically in Adobe RAW, and simply right clicking on the image in Bridge to bring up the option of opening it in Photoshop?

    <moved from Adobe Creative Cloud to Bridge General Discussion>

  • Adobe Bridge CC crashes when opening file with Photoshop CC or Camera RAW!

    Adobe Bridge CC crashes when opening file with Photoshop CC or Camera RAW!
    - Tried to Reset the preference with CTRL + Click.
    - It's just new clean install didn't do anything with it yet.
    - Windows 8.
    Any help?

    Just that one project, or any project?  Can you create new projects?

  • Opening files in Photoshop CS6

    Yesterday, before closing down, I uninstalled P/S 7, CS2 and CS3 to gain space, but do not know whether that action is relevant to my problem. Today I find that Jpegs will not open in Photoshop, and in Bridge only by going through Camera Raw. Photoshop will open tiffs, while Bridge will open some, but not all tiffs, through Camera Raw only. This problem follows many months of trouble-free operation of CS6.
    My operating system is Windows 7 Ultimate. I have downloaded the latest patches for CS6, and have set the Bridge Preferences item on File Associations to Default.
    Please, can someone throw light on this mystery?

    Thank you, Curt Y, I will certainly investigate your solution
    Best wishes, 
    John Rivers
    >-- Original Message --
    >Date: Tue, 09 Apr 2013 07:23:36 -0700
    >From: Curt Y <[email protected]>
    >Reply-To: [email protected]
    >To: sigint27 <[email protected]>
    >Subject: opening files in Photoshop CS6
    >
    >Curt Y http://forums.adobe.com/people/Curt+Y created the discussion
    >"Re: opening files in Photoshop CS6"
    >To view the discussion, visit: http://forums.adobe.com/message/5219186#5219186

  • Can't Open Files in Photoshop CS6 13.1.1

    Ever since I updated my Photoshop to 13.1.1 I can't open files in Photoshop. Everytime I try to use file > browse it hangs when I select a file to open and then when I try to just double-click on a .psd file in my normal Finder it never opens and it hangs the program.
    I'm running 10.8.2 on a 15" MBP Retina and using Creative Cloud. Any help would be appreciated since it's preventing me from working on this computer.

    Cyndi -
    I would start with the easiest thing Archive the preference file to your desktop then we can continue from there if that doesnt work.
    - Close PS
    - Type this into your run menu
    %appdata%/adobe/adobe photoshop cs3/
    - Now drag the Adobe Photoshop CS3 Settings folder onto your desktop
    - Keep the adobe folder window open
    - Launch PS
    - If this works then there was something corrupted in the preferences somewhere
    - If this doesnt work then delete the newly created preference folder from the adobe folder and drag the one from your desktop back into the adobe folder.
    Hope this helps.
    -Rilla

  • I can't open files in Photoshop

    All of sudden I am unable to open files in Photoshop, either by launching from a folder or opening in Photoshop... all I get is the spinning wheel of death. I've trashed my Photoshop preferences, ran cocktail, repaired permissions and restarted several times but nothing works. I've tried openeing several different files with the same (non) results.
    I'm using CS2.
    Please help!!!!!

    Thanks to everyone who replied to my query.
    I repeated the diagnostic steps again (trashed preferences, ran cocktail, repaired permissions) and it worked this time. The only thing different is that I disconnected my peripherals... not sure if that had anything to do with it.

  • Double clicking on file doesn't open file in Photoshop

    I've tried all the well-known fixes for this and they don't work. I'm on a Power Mac G5, 2MHz, running OS X 10.4.11, and Photoshop CS. I've been through the fixes for "can't open in Photoshop from double clicking file on desktop"-reinstalling Photoshop, reinstalling, then trashing the new Photoshop, and physically moving "Adobe Unit Types" into the "Scripting Additions" folder. There was a time when that worked. not any more. What happens now is: I double click on a Photoshop Tiff file, never touched by Preview. Result: the OS opens the file in Preview. So I trash all copies of Preview. this is driving me crazy. Try again. The OS, this time, opens the file in Colorsync Utility! I've never heard of it. So I trash all copies of Colorsync Utility. Try it again. The OS opens the Photoshop file in Illustrator. It appears that no power on earth will force the OS to open the Photoshop file in Photoshop. nothing will work. Can anybody help?

    Birck - as the others say you don't need to and shouldn't trash the other programs - I would recommend re-installing them asap. What you need to do is find the PS file you want to open and do a right-click over it and select 'get info' then find the 'open with' drop down menu and choose Photoshop. Once selected also click the 'change all' button below and close the get info window. Now all your PS files should open in the correct program :)
    Greg
    Edit - oops didn't see this had already been answered - hope things are working better for you now.

  • Windows 7/Bridge won't open files in Photoshop CS6 (cloud)

    I recently got the cloud CS6 and installed photoshop cs6, then uninstalled CS5.5. But now, Windows Explorer cannot seem to find Photoshop. If I try to associate the default for any file (.jpeg, .tiff, etc.) with Photoshop, Photoshop does not show up on the list of programs. I must browse to find  Photoshop exe (CS6 64). I click okay, but it continues to open the file in Windows picture viewer and to associate that file type with Windows Picture Viewer.
    If I right-click on the file, it does exactly the same thing. I must browse to Photoshop.exe. But it still opens the file in Windows Picture Viewer.
    Fix 1 Try Bridge Associations: I opened Bridge CS6->Edit>Preferences and made sure the files were associated with photoshop. But, when I then try to open the files from within Bridge, I get the message Windows cannot find c:Program Files\Adobe\AdobePhotoshop CS4 (64Bit)\Photoshop.exe. (my emphasis)  But I haven't had CS4 installed for years. I did not have this problem when I installed CS5. So now I can't open files from either Windows explorer or Adobe Bridge.
    Fix 2 Fix the Registry: So, I opened Regedit and went to HKEY_CLASSES_ROOT\Applications\Photoshop.exe\shell\open\command, and changed the (Default) from "C:\Program Files\Adobe\Adobe Photoshop CS5.1 (64 Bit)\Photoshop.exe" "%1" to "C:\Program Files\Adobe\Adobe Photoshop CS6 (64 Bit)\Photoshop.exe" "%1" . Don't know why the install left this at CS5.1. It SHOULD have changed it. EUREKA! Windows now recognizes Photoshop CS6 and I can associate files with it as usual. But I had to manually associate the native .psd file with Photoshop. along with .jpeg, .tiff and other image files.
    No Fix for Bridge: But back in Bridge CS6, it's not so rosy. I still get Windows cannot find c:Program Files\Adobe\AdobePhotoshop CS4 (64Bit)\Photoshop.exe. Make sure you typed the name correctly, and then try again. If I try File--Open with--Photoshop (default), I get the same message. Clearly, Bridge thinks Photoshop CS4 is the default, and I don't know where to change that association. Preferences does not allow browsing. So Bridge is pretty much useless.
    So what should I do about Bridge?
    Bridge CS6 still won't open Photoshop CS6. It's still looking for CS4. I thought about reinstalling Bridge, but when I try to download it, the cloud tells me it is is already installed and won't download. I am a little worried about uninstalling it and trying again. Maybe, I'll end up with no Bridge at all. I am beginning to regret my decision to go cloud. Don't know if the install mess is just cloud or noncloud versions as well. Doesn't seem to apply to all programs either.
    Postcript:
    I had to go to the registry and manually change CS5.1 to CS6 for InDesign and Illustrator as well, and then manually associate .indd and .ai files with those programs. What a pain this is. Obviously, the install program didn't change the normal associations to CS6. Left them with the CS5, and then when I uninstalled that--as anyone would normally do--it lost the association completely.

    Thank you David__B! Your suggestion worked perfectly. All the files are correctly associated in both Explorer and Bridge. And it didn't take all that long, mostly uninstalling. The Adobe App Manager very efficiently installs several different programs with very little fuss.
    I am not sure, but I think it may have been an old plug-in to Bridge back in the CS4 era that I didn't even know I had that was causing the Bridge file association problems. Uninstalling CS5 after installing CS6 seems to be causing Win Explorer problems, not just for me.  Based on this experience, I would recommend that anyone with several previous installations of Adobe CS do the following:
    Save your plugins and preference files in a back up file.
    Uninstall all the old adobe software.
    Run the the cleaner you suggested. (http://www.adobe.com/support/contact/cscleanertool.html).
    Install CS6 programs from the CCloud or wherever.
    Add your plug-ins back in as you need them one at a time to be sure they work.
    If you have already installed CS6 and are having file association problems, just uninstall everything and start at step one. You probably won't save time trying to fix the registry and manually associate file types--- yada yada yada.
    Steps 1-6 will give you a nice clean install and salvage only  good plug-ins.
    Beth

  • Open file in Photoshop CS4 with PDF open options

    Hi, I need to open Illustrator file in Photoshop with PDF open options and set the crop page options to media box. I am not sure how to do it. Here what I have that doesn't work:
    *open file "SPACE:Marketing:webTemplatesCreation:working:die_front.ai" with PDF open options media box crop page*
    Thank you for your help.
    Yulia

    Open options are a list… So you supply like so…
    open theFile as PDF with options ¬
    {class:PDF open options, bits per channel:eight, constrain proportions:true, crop page:media box, mode:CMYK, page:i, resolution:300, suppress warnings:true, use antialias:true, use page number:true}
    Where 'theFile' is an alias of your PDF file and 'i' is your page to open (if in a loop) else use an integer…

  • Cs6 Bridge will not open files in Photoshop cs6, get error message pasted below

    Windows cannot find C:/Program Files (x86)/Adobe/Adobe Photoshop CS3/Photoshop.exe
    I installed Photoshop CS6 Upgrade (64bit and 32Bit) to my PC which ran CS5 Extended.  When I deleted CS5, Bridge
    stopped opening files, whether I double clicked on the file or did Open with:  I get the same error message.

    By uninstalling CS5 you have corrupted file associations.  THey want to open in CS5 now and it is not on machine.
    You can either unistall CS6, do a script cleaner, and reinstall.
    Or you can change an entry in the registry.  Here is instructions from a previous post.
    I installed Photoshop CS6, then found CS5 was still there. I thought, hey, I don't need CS5 anymore, so I uninstalled CS5. then I found out that Photoshop was no longer available in 'Open with' when right-clicking an image...
    So I went into the Registry, HKEY_CLASSES_ROOT\Applications\Photoshop.exe\shell\open\command, and changed the (Default) from "C:\Program Files\Adobe\Adobe Photoshop CS5 (64 Bit)\Photoshop.exe" "%1" to "C:\Program Files\Adobe\Adobe Photoshop CS6 (64 Bit)\Photoshop.exe" "%1" (so changed CS5 to CS6) - and now I see 'Adobe Photoshop CS6' in my 'Open with' list when right-clicking an image...

  • Please help! I can't open files in Photoshop 2014.2

    I installed (and reinstalled and rebooted ad nauseum) Photoshop 2014.2 and now I can't open any files in Photoshop. When I click on a file in Bridge or in File Explorer, Photoshop will open but the file won't open.
    I'm running Windows 8.1.  I've updated my graphics card driver. My files aren't corrupt, because I can open them on 2014 on my laptop. Please, please help! I'm dead in the water and this is my business!

    What have you done for trouble.shooting other than re-installing (which would probably be pretty much moot anyway if one does not uninstall and use the clean script first)?
    http://blogs.adobe.com/crawlspace/2012/07/photoshop-basic-troubleshooting-steps-to-fix-mos t-issues.html

  • Bridge Problem opening files in Photoshop CS6

    CS6 Bridge appears to work fine, however when I try to open a file into Photoshop CS6 I get a flag saying it cannot find Photoshop CS4? Any ideas?
    TIA Keith

    PhotoGene47 wrote:
    You can open Bridge and change the file associations in Edit>File Type Associations to change to PS CS6.  That is the easiest way.  Another way would be to open Control Panel>Programs>Default Programs to change the file association for .jpeg, .psd., .tif, et cetera. 
    For your info, and others, this does not work in situations were the file associations become corrupted by uninstalling a previous version.  The mechanism for corruption is not quite clear to Adobe, but somehow the registry for file associations gets reset to the version that was deleted.  Since the normal methods of changing file associations, that you mention, do not affect the registry file in question, the problem still remains.  Therefore one needs to wipe files with the Adobe Script Cleaner or go in and change the registry.

  • Selecting the first file from a group of opened files in Photoshop

    Hi, I've been digitizing microfiche with 200 or so pages photographed onto one image file, laid out in a grid pattern. I've been using actions in Photoshop to cut out one page, create a new file in Photoshop from that page, then return to the first, master file and do it again with the next page in the series. So when it is complete I have each individual page as an individual image file which I then save with a batch process. I've been doing this for a while and have managed to make it work but I always run into the problem, when creating this action again, of getting Photoshop to select that first master file each time instead of selecting just the previous file. I know I can get it to select the previous file, or the previous file -1, -2, -3, etc. I've somehow been able to get this to work in the past by creating an action that selects a large enough group back, like previous file -19 or something, and through some bug or sheer luck it has worked and will always select that first file. But it doesn't always work and it always takes some frustration to luck into it when it does. Now I can't seem to get it to work at all. Is there a straightforward way I can simply tell it to select the first file everytime? If not, does anyone know how or why the method I used previously sometimes works and sometimes doesn't, and how I can make it work again? I'm using PS CS5 in Windows 7. Thanks!

    Just put this code on a file and put that 'namedfile.jsx' inside the scripts folder on photoshop.
    Open or re-open photoshop to load the script and create an action linked to a shortcut selected by you and save this script going to File>Scripts>namedfile.jsx
    It is just to press the shortcut key and the active image go back to the image opened before.
    When it is the first one it runs the script the same but it remains there.
    Here is the script:
    // Go back to the previous opened image
    #target photoshop
    // Go back to the previous opened image (not the previous viewed) . If it is the first, it remain there.
    if(documents.length>0) {
        var thisIndexImage = getActiveDocumentIndex();
        var theDocs = app.documents;
        if ( thisIndexImage != 0 ) {
            var flatAnterior = theDocs[thisIndexImage - 1];
            } else {
            var flatAnterior = theDocs[0];
        app.activeDocument = flatAnterior;
    } else {
        alert ("You must have opened images to run this script.")
    // Get the active document number - the number of opening order
    function getActiveDocumentIndex(){
         var ref = new ActionReference();
         ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
         return desc = executeActionGet(ref).getInteger(stringIDToTypeID('itemIndex'))-1;
    If you want to go directly to the first of all the images (in opening order) it is simpler:
    Just create this script:
    var first = app.documents[0];
    app.activeDocument = flatAnterior;

Maybe you are looking for