Skip navigation
Currently Being Moderated

Is it possible to open another application from a photoshop extension?

Jul 25, 2013 5:01 PM

Tags: #photoshop #adobe #builder #cs_extention_builder

I'd like to call an application from a photoshop extension including a parameter (ie "c:\path\myApplication.exe -p paramvalue".  I can see this can be done in AIR - but not found anything within a photoshop extension.  Am I missing something?  Is it possible?

 
Replies
  • Currently Being Moderated
    Jul 26, 2013 1:29 AM   in reply to wizbowes

    Hi,

     

    If you want to launch another Creative Suite then you can refer to the CS Communication Toolkit available in Extension Builder (Choose help > CS Extension Builder Extras). Otherwise please refer to the AIR APIs such as NativeProcess and openWithDefaultApplication.

     

    Kind regards,

    Lea

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 26, 2013 6:15 AM   in reply to wizbowes

    Not if you are building a CS Extension. You can use a number of AIR APIs in a CS Extension including Native Process.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 29, 2013 2:09 AM   in reply to wizbowes

    Are you writing a CS Extension in AIR? Or are you writing a native plugin in C++?

    If the former then you can just add the import statement where required and use the APIs. For example:

     

     

    <csxs:CSExtension xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:csxs="com.adobe.csxs.core.*">
    <fx:Script>
    <![CDATA[
    
      import flash.desktop.NativeProcess;
      import flash.desktop.NativeProcessStartupInfo;
      import flash.filesystem.File;
       private 
    function triggerNativeProcess():void  {
    
        var process:NativeProcess = null;
        var executable:File = new File("C:\\Windows\\system32\\notepad.exe");
        startNotepadCmd(executable);
      }
    
      protected
    
     static function startNotepadCmd(notepadCmd:File):void
      { 
    
        var process:NativeProcess = null;
    
        var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();    nativeProcessStartupInfo.executable = notepadCmd;
        nativeProcessStartupInfo.workingDirectory = notepadCmd.parent;
    
        process = 
    new NativeProcess(); 
        process.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, onNativeProcessOutputData, 
    false, 0, true);    process.addEventListener(ProgressEvent.STANDARD_ERROR_DATA, onNativeProcessErrorData, 
    false, 0, true);    process.addEventListener(NativeProcessExitEvent.EXIT, onNativeProcessExit, 
    false, 0, true);
        process.start(nativeProcessStartupInfo);
       }
       
    ]]>
    </fx:Script>
    
    
    </csxs:CSExtension>
    

     

    Kind regards,

    Lea

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points