"Change layers in ACR" might be executed or by script?

I am trying to integrate the Dr. Brown: Script CS5: change the layers in ACR (http://www.russellbrown.com/scripts.html)

in an existing workflow, not my choice.

Here is my delemna. I'm provided CMYK PSD files, and my final backup files must be CMYK PSD.

ACR via Bridge wants TIFFs, script Dr. Brown wants RGB. I know that I can batch convert TIFF or RGB, if necessary, but I think a action/script running in each open file could be simpler and less subject to error or oversight, as each image will be individually opened and edited in any case.

The way I am treated this manually is as follows:

Open PSD CMYK.

Duplicate the Image

Convert the Dupe in RGB

Run the script of "Layers in ACR" on RGB Dupe

Brand changes and click OK in the ACR

+ Shift + drag resulting RGB Dupe layer in the original document of CMKY (centered)

Close the Dupe without saving changes

This gives me a new layer of ACR'ed to blend/mask in my original necessary file.

I tried the action of these steps and everything is working properly through ACR... but... the action is not which actually layer Dupe/cab ' ed more at the Original (drag and drop) document. The ACR Dupe'ed is closed so that the original file is left unchaged.

How can I automate the transfer of the Dupe to the Original layer?

I made a good many changes to Dr. Borwns layers of change in the script of the cab. Here are some of the most important changes.

1. now supports color RGB, CMYK, Lab and grayscale modes. If the document is not embedded tiff RGB is converted to RGB using RGB profile for work in Photohsop.

2 now supports vector masks.

3. the density and the pen of the mask Panel settings are now kept for channel and vector masks.

4. now, to keep the name of the original layer.

5. don't use a State in history.

It is a script of CS5. It can work in CS4, but I didn't test.

On my system when the document canvas size get above about 20-25 members ACR really slows down. Well above that and it takes too much time or crashes. So I would say that this script is not designed for documents with sizes really big canvas in high resolution.

I could not find a way to replace the contents of a smart object with a tiff file and do not have the ACR dialog show when the ACR are set to change the TIFF in ACR. Because of this it really cannot be registered by an action, the ACR dialog box will always show. If you install the script in the scripts folder, it can be called from an action like any other script. It just does not work in batch mode.

Support the transparent layer is still is not ideal because ACR does not support transparency. If it was my script, I drop the support of the transparent layer instead of trying to force ACR to do something is was not designed to do.

// c2011 Adobe Systems, Inc. All rights reserved.
// Produced and Directed by Dr. Brown ( a.k.a Russell Preston Brown )
// Written by Tom Ruark because I wrote listener! I get credit for all listener code.

/*
@@@BUILDINFO@@@ Dr Browns Edit Layer in ACR.jsx 1.1.1
*/

// enable double clicking from the Macintosh Finder or the Windows Explorer
#target photoshop

// save some state so we can restore
// we pop the ACR dialog so users can cancel out and we are in a bad state
var historyDocument = app.activeDocument;
var historyState = app.activeDocument.activeHistoryState;
var isCancelled = true;

app.activeDocument.suspendHistory( 'Dr Browns Edit Layer in ACR', 'EditLayerInACR();');
if( isCancelled ){
     if (historyDocument != app.activeDocument) {
          app.activeDocument.close( SaveOptions.DONOTSAVECHANGES );
     }
     app.activeDocument = historyDocument;
     app.activeDocument.activeHistoryState = historyState;
}
isCancelled ? 'cancel' : undefined;// do not localize cancel

function EditLayerInACR(){
// Show this message just once.
// If I have preferences then I must of done this already.
var message = "Special Instructions\r";
message += "Make sure that you have set your Camera Raw Preferences to the following setting:\r";
message += "(Automatically open all supported TIFFs)\r";
message += "To access this preference setting, go to your Main Menu and select: Photoshop/Preferences/Camera Raw\r";
message += " \rAlso, your default resolution for TIFF images in ACR must be set to 240ppi. If you see your layers change in size, then you know that your resolution is not set correctly.\r";
message += "";

var optionsID = "5714ecb5-8b21-4327-bf64-135d24ea7131";
var showMessage = true;
try {
    var desc = app.getCustomOptions(optionsID);
    showMessage = false;
}
catch(e) {
    showMessage = true;
}

if (showMessage) {
    alert(message);
    var desc = new ActionDescriptor();
    desc.putInteger(charIDToTypeID('ver '), 1);
    app.putCustomOptions(optionsID, desc);
}

var tempName = "Raw Smart Temp";
var tempFile = new File( Folder.temp.toString() + "/" + tempName + ".tif" );

try {

// make sure active layer is a normal art layer
if( app.activeDocument.activeLayer.typename != 'ArtLayer' || app.activeDocument.activeLayer.kind != LayerKind.NORMAL ) return 'cancel';

// change image res to match defalut ACR 240
if( app.activeDocument.resolution != 240 ) {
     var docRes = app.activeDocument.resolution;
     app.activeDocument.resizeImage(undefined, undefined, 240, ResampleMethod.NONE);
}

var channelMask = hasChannelMask();
var vectorMask = hasVectorMask();
var layerTransparency = HasLayerTransparency();

// save channel mask if exists
if( channelMask && !layerTransparency ) {
     var channelMaskSettings = getChannelMaskSettings();
    var tempAlpha = channelMaskToAlphaChannel();
     deleteChannelMask();
}
// save vector mask if exists
if( vectorMask && !layerTransparency ) {
     var vectorMaskSettings = getVectorMaskSettings();
    app.activeDocument.pathItems[app.activeDocument.pathItems.length-1].duplicate( 'tempPath' );
     app.activeDocument.pathItems[app.activeDocument.pathItems.length-1].remove();
}
if( layerTransparency ) {
     if( channelMask ){// apply existing channel mask
         var desc = new ActionDescriptor();
        var ref = new ActionReference();
        ref.putEnumerated( charIDToTypeID('Chnl'), charIDToTypeID('Chnl'), charIDToTypeID('Msk ') );
          desc.putReference( charIDToTypeID('null'), ref );
          desc.putBoolean( charIDToTypeID('Aply'), true );
          executeAction( charIDToTypeID('Dlt '), desc, DialogModes.NO );
     }
     if( vectorMask ) {// save existing vector mask
          var vectorMaskSettings = getVectorMaskSettings();
          app.activeDocument.pathItems[app.activeDocument.pathItems.length-1].duplicate( 'tempPath' );
          app.activeDocument.pathItems[app.activeDocument.pathItems.length-1].remove();
     }
     var transMask = layerTransparencyToAlpha();
     // stamp visible
     var desc = new ActionDescriptor();
    desc.putBoolean( charIDToTypeID('Dplc'), true );
    executeAction( charIDToTypeID('MrgV'), desc, DialogModes.NO );
     // merge down
     executeAction( charIDToTypeID('Mrg2'), undefined, DialogModes.NO );
}

convertLayerToACRSmartObject();

// create a  channel mask from original layer transparency
// currently does not support a layer with transparency and existing channels mask.
if( layerTransparency ) {
     alphaToChannelMask( transMask );
     transMask.remove();
     if( vectorMask ) {
          app.activeDocument.pathItems['tempPath'].select();
          createVectorMask();
          setVectorMaskDensity( vectorMaskSettings.density );
          setVectorMaskFeather( vectorMaskSettings.feather );
          app.activeDocument.pathItems['tempPath'].remove();
     }
}
// restore channel mask if needed
if( channelMask && !layerTransparency ) {
     alphaToChannelMask( tempAlpha );
     setChannelMaskDensity( channelMaskSettings.density );
     setChannelMaskFeather( channelMaskSettings.feather );
     tempAlpha.remove();
}
// restore vector mask if needed
if( vectorMask && !layerTransparency ) {
     app.activeDocument.pathItems['tempPath'].select();
     createVectorMask();
     setVectorMaskDensity( vectorMaskSettings.density );
     setVectorMaskFeather( vectorMaskSettings.feather );
     app.activeDocument.pathItems['tempPath'].remove();
}

// well at least this is the same!
// replace contents of selected smart object
var desc = new ActionDescriptor();
desc.putPath( charIDToTypeID( "null" ), tempFile );
executeAction( stringIDToTypeID( "placedLayerReplaceContents" ), desc, DialogModes.NO );

tempFile.remove();

// convert back to orginal resolution
if( docRes != undefined ) app.activeDocument.resizeImage(undefined, undefined, docRes, ResampleMethod.NONE);

isCancelled = false;// no errors so save to record
} /* try block ender */
catch(e) {
     if( tempFile.exists ) tempFile.remove();
}

//////////////////////////////////////////////////////////////////////////////
/////////////////////// functions below /////////////////////////
//////////////////////////////////////////////////////////////////////////////

// see if i can tell that this layer has transparent pixels
function HasLayerTransparency() {
    var hasTransparency = false;
     if( app.activeDocument.activeLayer.isBackgroundLayer ) return false;
    try {
        SelectLayerTransparency();
        var s = activeDocument.selection;
        if ( null != s && ! s.solid ) {
            activeDocument.selection.deselect();
            return true;
        }
        if ( (s[2].value - s[0].value) == activeDocument.width.value &&
             (s[3].value - s[1].value) == activeDocument.height.value) {
            activeDocument.selection.deselect();
            return false;
        }
        activeDocument.selection.deselect();
    }
    catch(e) {
        activeDocument.selection.deselect();
        hasTransparency = false;
    }
    return hasTransparency;
};
function SelectLayerTransparency() {
    var desc = new ActionDescriptor();
        var ref = new ActionReference();
        ref.putProperty( charIDToTypeID( "Chnl" ), charIDToTypeID( "fsel" ) );
    desc.putReference( charIDToTypeID( "null" ), ref );
        var ref = new ActionReference();
        ref.putEnumerated( charIDToTypeID( "Chnl" ), charIDToTypeID( "Chnl" ), charIDToTypeID( "Trsp" ) );
    desc.putReference( charIDToTypeID( "T   " ), ref );
    executeAction( charIDToTypeID( "setd" ), desc, DialogModes.NO );
};
function SaveAsTIFF( inFileName ) {
     var tiffSaveOptions = new TiffSaveOptions();
     tiffSaveOptions.embedColorProfile = true;
     tiffSaveOptions.imageCompression = TIFFEncoding.TIFFLZW;
     tiffSaveOptions.alphaChannels =  false;
     tiffSaveOptions.layers = false;
     app.activeDocument.saveAs( new File( inFileName ), tiffSaveOptions, true, Extension.LOWERCASE );
};
// a color mode independent way to make the component channel active.
function selectComponentChannel() {
    try{
        var map = {};
        map[DocumentMode.GRAYSCALE] = charIDToTypeID('Blck');// grayscale
        map[DocumentMode.RGB] = charIDToTypeID('RGB ');
        map[DocumentMode.CMYK] = charIDToTypeID('CMYK');
        map[DocumentMode.LAB] = charIDToTypeID('Lab ');
        var desc = new ActionDescriptor();
            var ref = new ActionReference();
            ref.putEnumerated( charIDToTypeID('Chnl'), charIDToTypeID('Chnl'), map[app.activeDocument.mode] );
        desc.putReference( charIDToTypeID('null'), ref );
        executeAction( charIDToTypeID('slct'), desc, DialogModes.NO );
    }catch(e){}
};
// function to see if there is a raster layer mask, returns true or false
function hasChannelMask(){
     if( app.activeDocument.activeLayer.isBackgroundLayer ) return false;
     var ref = new ActionReference();
     ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
     return executeActionGet( ref ).getBoolean( stringIDToTypeID( 'hasUserMask' ) );
};
// function to see if there is a vector layer mask, returns true or false
function hasVectorMask(){
     if( app.activeDocument.activeLayer.isBackgroundLayer ) return false;
     var ref = new ActionReference();
     ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
     return executeActionGet( ref ).getBoolean( stringIDToTypeID( 'hasVectorMask' ) );
};
// create an new alpha from layer channel mask, returns channel object.
function channelMaskToAlphaChannel() {
    var desc = new ActionDescriptor();
        var ref = new ActionReference();
        ref.putEnumerated( charIDToTypeID('Chnl'), charIDToTypeID('Chnl'), charIDToTypeID('Msk ') );
    desc.putReference( charIDToTypeID('null'), ref );
    executeAction( charIDToTypeID('Dplc'), desc, DialogModes.NO );
    var dupedMask = app.activeDocument.activeChannels[0];
    selectComponentChannel();
    return dupedMask;
};
function deleteChannelMask() {
    var desc = new ActionDescriptor();
        var ref = new ActionReference();
        ref.putEnumerated( charIDToTypeID('Chnl'), charIDToTypeID('Chnl'), charIDToTypeID('Msk ') );
    desc.putReference( charIDToTypeID('null'), ref );
    executeAction( charIDToTypeID('Dlt '), desc, DialogModes.NO );
};
// creates a layer channel mask from a channel object
function alphaToChannelMask( alpha ) {
     var desc = new ActionDescriptor();
    desc.putClass( charIDToTypeID( "Nw  " ), charIDToTypeID( "Chnl" ) );
     var ref = new ActionReference();
        ref.putEnumerated( charIDToTypeID( "Chnl" ), charIDToTypeID( "Chnl" ), charIDToTypeID( "Msk " ) );
    desc.putReference( charIDToTypeID( "At  " ), ref );
    desc.putEnumerated( charIDToTypeID( "Usng" ), charIDToTypeID( "UsrM" ), charIDToTypeID( "RvlA" ) );
     executeAction( charIDToTypeID( "Mk  " ), desc, DialogModes.NO );
    var desc = new ActionDescriptor();
        var ref = new ActionReference();
        ref.putEnumerated( charIDToTypeID('Chnl'), charIDToTypeID('Chnl'), charIDToTypeID('Msk ') );
    desc.putReference( charIDToTypeID('null'), ref );
    desc.putBoolean( charIDToTypeID('MkVs'), false );
    executeAction( charIDToTypeID('slct'), desc, DialogModes.NO );
    var desc = new ActionDescriptor();
        var desc1 = new ActionDescriptor();
            var ref = new ActionReference();
            ref.putName( charIDToTypeID('Chnl'), alpha.name );
        desc1.putReference( charIDToTypeID('T   '), ref );
        desc1.putBoolean( charIDToTypeID('PrsT'), true );
    desc.putObject( charIDToTypeID('With'), charIDToTypeID('Clcl'), desc1 );
    executeAction( charIDToTypeID('AppI'), desc, DialogModes.NO );
    selectComponentChannel();
};
// creates a new alpha channel from active layer's transparency, returns channel object
function layerTransparencyToAlpha() {
     var tempAlpha = app.activeDocument.channels.add();
     var desc = new ActionDescriptor();
        var desc1 = new ActionDescriptor();
            var ref = new ActionReference();
            ref.putEnumerated( charIDToTypeID('Chnl'), charIDToTypeID('Chnl'), charIDToTypeID('Trsp') );
        desc1.putReference( charIDToTypeID('T   '), ref );
        desc1.putBoolean( charIDToTypeID('PrsT'), true );
    desc.putObject( charIDToTypeID('With'), charIDToTypeID('Clcl'), desc1 );
    executeAction( charIDToTypeID('AppI'), desc, DialogModes.NO );
     selectComponentChannel();
     return tempAlpha;
};
// gets channel mask settings, returns custom object
function getChannelMaskSettings(){
     var ref = new ActionReference();
     ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
     var desc = executeActionGet(ref);
     var channelMask = {};
     // density should be percent. it is 0-255 instead. so convert because percent is need to set
     channelMask.density = Math.round((desc.getInteger( stringIDToTypeID( 'userMaskDensity' ) ) / 255)*100);
     channelMask.feather = desc.getUnitDoubleValue( stringIDToTypeID( 'userMaskFeather' ) );
     return channelMask;
};
function setChannelMaskDensity( density ) {// integer
     var desc = new ActionDescriptor();
        var ref = new ActionReference();
        ref.putEnumerated( charIDToTypeID('Lyr '), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
    desc.putReference( charIDToTypeID('null'), ref );
        var desc1 = new ActionDescriptor();
        desc1.putUnitDouble( stringIDToTypeID('userMaskDensity'), charIDToTypeID('#Prc'), density );
    desc.putObject( charIDToTypeID('T   '), charIDToTypeID('Lyr '), desc1 );
    executeAction( charIDToTypeID('setd'), desc, DialogModes.NO );
};
function setChannelMaskFeather( feather ) {// double
     var desc = new ActionDescriptor();
        var ref = new ActionReference();
        ref.putEnumerated( charIDToTypeID('Lyr '), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
    desc.putReference( charIDToTypeID('null'), ref );
        var desc1 = new ActionDescriptor();
        desc1.putUnitDouble( stringIDToTypeID('userMaskFeather'), charIDToTypeID('#Pxl'), feather );
    desc.putObject( charIDToTypeID('T   '), charIDToTypeID('Lyr '), desc1 );
    executeAction( charIDToTypeID('setd'), desc, DialogModes.NO );
};
// gets vector mask settings, returns custom object
function getVectorMaskSettings(){
     var ref = new ActionReference();
     ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
     var desc = executeActionGet(ref);
     var vectorMask = {};
     vectorMask.density = Math.round((desc.getInteger( stringIDToTypeID( 'vectorMaskDensity' ) ) / 255)*100);
     vectorMask.feather = desc.getUnitDoubleValue( stringIDToTypeID( 'vectorMaskFeather' ) );
     return vectorMask;
};
function setVectorMaskDensity( density ) {// integer
     var desc = new ActionDescriptor();
        var ref = new ActionReference();
        ref.putEnumerated( charIDToTypeID('Lyr '), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
    desc.putReference( charIDToTypeID('null'), ref );
        var desc1 = new ActionDescriptor();
        desc1.putUnitDouble( stringIDToTypeID('vectorMaskDensity'), charIDToTypeID('#Prc'), density );
    desc.putObject( charIDToTypeID('T   '), charIDToTypeID('Lyr '), desc1 );
    executeAction( charIDToTypeID('setd'), desc, DialogModes.NO );
};
function setVectorMaskFeather( feather ) {// double
     var desc = new ActionDescriptor();
        var ref = new ActionReference();
        ref.putEnumerated( charIDToTypeID('Lyr '), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
    desc.putReference( charIDToTypeID('null'), ref );
        var desc1 = new ActionDescriptor();
        desc1.putUnitDouble( stringIDToTypeID('vectorMaskFeather'), charIDToTypeID('#Pxl'), feather );
    desc.putObject( charIDToTypeID('T   '), charIDToTypeID('Lyr '), desc1 );
    executeAction( charIDToTypeID('setd'), desc, DialogModes.NO );
};
// create a layer vector mask from active path
function createVectorMask() {
  try{
    var desc = new ActionDescriptor();
        var ref = new ActionReference();
        ref.putClass( charIDToTypeID('Path') );
    desc.putReference( charIDToTypeID('null'), ref );
        var mask = new ActionReference();
        mask.putEnumerated( charIDToTypeID('Path'), charIDToTypeID('Path'), stringIDToTypeID('vectorMask') );
    desc.putReference( charIDToTypeID('At  '), mask );
        var path = new ActionReference();
        path.putEnumerated( charIDToTypeID('Path'), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
    desc.putReference( charIDToTypeID('Usng'), path );
    executeAction( charIDToTypeID('Mk  '), desc, DialogModes.NO );
  }catch(e){ return -1; }
};
// converts the active layer into a tiff embedded smart object so it can be edited in ACR .
// editing in ACR requires ACR preferences to be set to edit all supported tiffs
function convertLayerToACRSmartObject(){
     var layerName = app.activeDocument.activeLayer.name;
     app.activeDocument.activeLayer.name = "Raw Smart Object";
     // trim layer to document bounds.
     app.activeDocument.crop(app.activeDocument.activeLayer.bounds);
     // convert selected layer to smart object
     executeAction( stringIDToTypeID( "newPlacedLayer" ), undefined, DialogModes.NO );
     //  edit selected smart object
     executeAction( stringIDToTypeID( "placedLayerEditContents" ), new ActionDescriptor(), DialogModes.NO );
     if(app.activeDocument.bitsPerChannel != BitsPerChannelType.SIXTEEN) app.activeDocument.bitsPerChannel  = BitsPerChannelType.SIXTEEN;
     if(app.activeDocument.mode != DocumentMode.RGB) app.activeDocument.changeMode(ChangeMode.RGB);
     SaveAsTIFF( tempFile );
     app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
     app.activeDocument.activeLayer.name = layerName;
};
};// end EditLayersInACR()

Tags: Photoshop

Similar Questions

  • OnLoad, execute a javascript script

    I need to execute a javascript script that will set the values to some drop-down lists and some textfields on page load. I can simply write that on a field, but I want to run it when loading PDF.

    You must use a script at the level of the doc, then.

    You can create one via Tools - JavaScript - Document JavaScripts.

    Here is a simple example of a script that sets the value of a text field:

    this.getField("Text1").value = "12345";

  • Change the value of the radio button using Java Script

    Hi I have a radio button "Process_mode" with two 'ONLINE' and 'Offline' values.
    based on the selection criteria, I will call the process_mode() function and if the user presses the ok button I want to change the proces_mode offline.
    Here's my java script.
    but it does not change the value of the variable.
    Please suggest how to proceed.

    function process_mode()
    {
    confirm_msg = confirm ("your search criteria is complex.") It is proposed to submit the application in offline mode. do you want offline? ») ;
    If (confirm_msg is true)
    {
    $x('p2_process_mode').value = "out of the CONNECTION";
    $x('P2_HIDDEN_PROCESS_MODE').value = "offline";
    }
    }
    doSubmit ('BTN_FINAL_COUNT');
    Alert ("your application has been submitted. Please wait until the system processes your request.') ;

    Thanks and greetings

    Ashok Salimath

    Published by: user644340 on July 19, 2009 23:11

    Hey Ashok,

    A Radio element generates actually individual boxes within a radiogroup (this is done by giving the same "name" attribute to each key). Each button has its own attribute 'ID', which will be the name of the option page more "_n" - where n is a number from 0 (zero) - so the first button will be, say, "P1_RADIO_0", then the second will be "P1_RADIO_1" and so on.

    To set the value of the radiogroup and, therefore, article, you need to 'check' one of the buttons - this is done by setting its 'checked' true value. For example, if "Offline" is the second radio button to the P2_PROCESS_MODE element:

    $x('P2_PROCESS_MODE_1').checked = true;
    

    Andy

  • How to execute a Perl Script in ODI and Catch error

    Hi all

    Someone knows how to execute a Perl script in a package? And also how capture/error log when occurs?
    Gladly appreciate your answers.

    Thank you
    Randy

    Published by: [email protected] on March 12, 2009 12:29 AM

    Hi Randy,

    Use the OS command to achieve this. In your package add command OS and in the command line, specify the path of your perl script.

    PS: Make sure that your agent may be able to access this location/path specified.

    Thank you
    G

  • buttons change layers when creating interactive PDF HELP!

    I have a lot of documents with images that need to be enlarged, so for each image (a few pages with a single image, others with 4 or 5) I create the image as a button.  In a new layer called overlay, I create a greybox on the page and the bigger picture and more than (the two buttons and hidden initially).

    If the layers order goes like this:

    Big picture (top)

    GreyBox

    small image.

    Preview interactive ePub in InDesign is on-site.  The button to reveal and hide the images correctly and are in the correct order.

    HOWEVER, when I generate an interactive PDF, pages look fine until I click on a button, but once I click on a picture, I get:

    big picture is cut UNDER the greybox.

    Small image is above the large image.

    I published the document online and when displayed in a browser, all the problems disappear (I remember that it uses the same engine as the preview interactive ePub) but when I download the on-line document, the errors come back.

    I feel really it is a bug in InDesign (Adobe listening?) and if anyone has had similar problems, I'd like to hear about them.

    Any help gratefully received.

    Thank you

    Ian

    Try the object > interactive > set tab order

  • Error in executing the PowerCLI script change IOPS / s

    M community you want to run the script below, however when run got the following error in the result.

    Please could you help me?

    # SCRIPT TO #.

    $hostesxi = get-Content - Path "C:\Users\vsilva\Desktop\hostsinfo.csv".

    $DiskID = get-Content - Path "C:\Users\vsilva\Desktop\diskiops.csv".

    SE connect-VIServer-Server $hostesxi - user "myuser" - password "MonMotpasse".

    # $esxcli.system.hostname.get () #.

    $esxcli = get-EsxCli - VMHost $hostesxi

    $esxcli.storage.nmp.device.list () | where {$_.} Device-match $DiskID} | $esxcli.storage.nmp.psp.roundrobin.deviceconfig.set % (0, $null, $_.) Device, 1, "OPS", 0)

    ------------------------------------------------------------------------------------------------------

    # OUT #BUG #.

    Could not find an overload for the 'set' and the number of arguments: "6".

    C:\Users\vsilva\Desktop\changeiops.ps1:9 char: 1

    + $esxcli.storage.nmp.device.list () | where {$_.} Device-match $DiskID} | % $esxcli. ...

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo: NotSpecified: (:)) [], MethodException)

    + FullyQualifiedErrorId: MethodCountCouldNotFindBest

    Thank you all,.

    More could solve my problem in a way report, for me this exellent, must be attached to the completed manuscript shares with the community.

    Good bye.

  • Syntax error to execute a javaScript script

    Hi all

    I want to run a JavaScript using AppleScript script method.

    I first create a document to help

    say application "Adobe InDesign CS5.5.

    set myDocument to do document

    end say


    Now I run this script


    the value ScriptPath to alias "HD:private:var:root:Documents:Adobe Scripts: Source1.jsx.

    say application 'Adobe InDesign CS5.5'

    script ScriptPath language javascript

    end say

    But it gives error

    error "Adobe InDesign CS5.5 was an error: syntax error" number 8

    I also try:

    the value ScriptPath to alias "HD:private:var:root:Documents:Adobe Scripts: Source1.jsx.

    say application "Adobe InDesign CS5.5.

    set myDocument to do document

    script ScriptPath language javascript

    end say


    No compilation error

    The runtime gives the same error "Adobe InDesign CS5.5 was an error: syntax error" number 8

    If I create the document using this:


    say application "Adobe InDesign CS5.5.

    set myDocument to do document

    end say


    and run Source1.jsx using extend Script Toolkit CS5.5 then script executed successfully.

    My Java Script is:

    indesign #target

    myDocument var = app.activeDocument;

    with (myDocument.documentPreferences)

    {

    pageHeight = "11i";

    pageWidth = "8.5I";

    pagesRegard = false;

    pageOrientation = PageOrientation.portrait;

    pagesPerDocument = 1;

    }

    myLayer var = myDocument.layers.add ();

    myLayer.name = "myFirstLayer";

    myLayer.visible = true;

    var masterspread = myDocument.masterSpreads.add (1);

    masterspread.baseName = "NewMasterPage";

    masterspread. Select (1919250519);

    var myTextFrame = masterspread.textFrames.add (myDocument.layers.item ("myFirstLayer"));

    myTextFrame.geometricBounds = ["6 p", "p 25", "30 p", "30 p"];

    myTextFrame.contents = 'Spread Master';

    I don't understand where is syntax error.

    say application "Adobe InDesign CS5.5.

    script alias "HD:private:var:root:Documents:Adobe Scripts: Source1.jsx" javascript language

    --> error 'Syntax error' number 8

    Result:

    error "Adobe InDesign CS5.5 was an error: syntax error" number 8



    Thank you.




    have you tried to flee the estk javascript? or debug?

    and... Why the hell you mix the applescript a javascript like that?

    var myTextFrame = masterspread.textFrames.add (myLayer);

  • Change the LV version currently active in the batch script

    Hello

    I use two different applications on my computer, and one of them should run in LV 2011, this in LV 2012. The two versions are installed and it works fine until I start the correct version of LV manually before you start the application (start and end of the required version of LV in C:\Program Files (x 86) \National Instruments\... before starting my request).

    I want to do this automatically in a command script, so basically I want to do the following:

    * Check which version of LV is currently active (last LV start version)

    * If the currently active version of LV is NOT required: change to the required version of LV (by starting LV and close or preferably do differently if someone could tell me how)

    * If the currently active version of LV is required: do nothing

    There are two problems I couldn't solve so far:

    * How to get the LV version currently active (I checked the windows registry, but I see that my installed versions of LV, and not one that is currently active)

    * How can I close LV with a batch script (or how to change the version of the currently active LV without opening and closing)

    Thanks in advance,

    Tobias

    PS: I did the same for the different versions of TestStand, by reading the TestStand system and if requuired environment variable change the version of TestStand via the command-line of the TS Version selector. It works fine, but there is no system environment variable that indicates the currently active version of LV.

    OK, this is a very informal Tip:

    In the registry (regedit), you will find the key 'HKEY_CLASSES_ROOT\LabVIEW.Application\CLSID '. This default key should contain some weird ID information.

    If you search for this key, you will find an entry for the key in the "HKEY_CLASSES_ROOT CLSID" section.

    If you have several versions of installed LV, there must be a key in the entry which will give you the path to the active version of NV. don't forget: this is the version that you have opened up to the last successfully!

    Please note that keys can change from system to System. Also different versions of LV can use different keys like "routing information" the way of the real LabVIEW.exe.

    hope this helps,

    Norbert

  • How to execute a Perl script and returns the value as a string?

    Hi, I am trying to build an application using the eclipse 2.0.0 with the Blackberry SDK 7.1 plug-in. currently I tested Simulator 9900 version 7.1.0.523. I need to use the Perl language to access the raw biological database and returns as a string without having to write a longer program using java.

    In a stand alone Java SDK, I can use the line:

    Process p = Runtime.getRuntime () .exec ("perl script.pl")

    but when I tried to use it on the IDE for a Blackberry project, the project will not compile. It is said:

    Method exec (String) is undefined for the type of Runtime

    Hopes, can someone show me the correct syntex to use, but if no class is available, could someone show me a sample for unified research process? The names of blackberry dev is very complicated, I can't find any samples for her.

    Thank you.

    Seems interesting.

    Your idea was to download the data to the BlackBerry and then directly execute queries.

    Although there are a number of other obstacles, the first fall you in East platforms supporting Perl.  Here is the list:

    http://perldoc.Perl.org/perlport.html#supported-platforms

    BlackBerry OS Java is not included - in fact the only ' included phone OS is Symbian.  Interestingly, it seems likely that PlayBook and BB10, because they are based on the QNX operating system.

    If we discard Perl as a query language, then you will need to provide another option to search.  I think that unified search is an option, but you will have some work to do to use it.  The first thing you should do is find out if in fact, you can download the database on the BlackBerry.  The only available on the Blackberry database engine's SQL, so if you want the database can be exported to a SQL database, there is a chance that it would work.  I had a quick glance around the site, and I can't tell what the "database" is in the format.  Then I suggest that look you at that next.

    I hope this helps.

  • Can you align child layers to their parents in the timeline using scripts?

    OK, so I'm very new to scripting. Right now I'm looking for a way to align layers in the scenario with the other.

    So, if, for example - if 3 NULL values were related to a model like this:

    CompQ1.PNG

    I want to be able to line the children up to their parent, to look like this:

    CompQ2.PNG

    So far I tried to find the time when the Solid Black comp begins within Comp 1, but I only managed to find the values of the model Solid Black inPoint which are always relative to the model itself, and not when it is actually active in Comp 1. When I look at the script guide, it does not resemble the Ae allows you to access the timeline like this.

    Any ideas?

    Is it still possible?

    Play with this:

    var app.project.activeItem = myComp;

    for (var i = 1; i)<= mycomp.numlayers;="">

    If (myComp.layer (i) .parent! = null) {}

    myComp.layer (i) .startTime += myComp.layer (i).parent.inPoint - myComp.layer (i) .inPoint;

    }

    }

    Dan

  • Reference failed with "Agent already has a script execute task"TaskId (SCRIPT, attbid, BaselineUpdate)"

    Hello

    EndecaScriptService service script fails with the following exception when you try to run indexing. I checked is there is any job stuck in InMemoryQueue but none. Please let us know how to fix the error below. Script only service fails, but the records are loaded into the record store. As a temp work around we run the base with in short.

    ProductCatalogSimpleIndexingAdmin - atg.repository.search.indexing.IndexingException: failed to start application attbid BaselineUpdate script

    ProductCatalogSimpleIndexingAdmin to atg.endeca.eacclient.ScriptRunner.startScript(ScriptRunner.java:277)

    ProductCatalogSimpleIndexingAdmin to atg.endeca.eacclient.ScriptIndexable.runUpdateScript(ScriptIndexable.java:262)

    ProductCatalogSimpleIndexingAdmin to atg.endeca.eacclient.ScriptIndexable.performBaselineUpdate(ScriptIndexable.java:202)

    ProductCatalogSimpleIndexingAdmin to atg.endeca.index.admin.IndexingTask.doTask(IndexingTask.java:421)

    ProductCatalogSimpleIndexingAdmin to atg.endeca.index.admin.IndexingTask.performTask(IndexingTask.java:364)

    ProductCatalogSimpleIndexingAdmin to atg.endeca.index.admin.IndexingPhase$ IndexingTaskJob.invoke (IndexingPhase.java:476)

    ProductCatalogSimpleIndexingAdmin to atg.common.util.ThreadDispatcherThread.run(ThreadDispatcherThread.java:178)

    ProductCatalogSimpleIndexingAdmin caused by: an error occurred trying to start the script: Agent already has a 'TaskId (SCRIPT, attbid, BaselineUpdate)' execute script task: Agent already has a task of running script "TaskId(SCRIPT,attbid,BaselineUpdate)".

    ProductCatalogSimpleIndexingAdmin at sun.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method)

    ProductCatalogSimpleIndexingAdmin at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

    ProductCatalogSimpleIndexingAdmin at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

    ProductCatalogSimpleIndexingAdmin to java.lang.reflect.Constru

    Can you try to kill the forging process running and then try again the kickoff of basic indexing?

  • Executing a dynamic script from SQLPLUS name?

    I have a script that will run in SQLPLUS.

    I need the script to query a table and assign the result value to a variable.  Then I have to call a second script showing the value of this variable.

    Here is an example of generic non-what I need to do.  I need to insert a value into the variable "scriptname" can run the script with this name.  Is this possible?  By the way the value of a file beats or something is not possible in this situation.

    DECLARE ScriptName VARCHAR2 (50);

    BEGIN

    -Get the name of the script

    SELECT NextScript IN GenericTable ScriptName;

    -Run the script

    @ScriptName

    END;

    /

    Not really possible.

    All PL/SQL code will be submitted to the database must be performed, so that the database can not run scripts back on the client SQL * more tool, as the control is not returned to SQL * more until that code PL/SQL completed.

    If the scripts are on the server, then you might have a PL/SQL code that loops through the script names and submits the work to be performed immediately using DBMS_SCHEDULER, he call sqlplus command line with the relevant script / etc paths, but if your going to go to all that trouble It would be easier to put scripts in packages/procedures etc. PL/SQL code and just call those that you need.

  • How to change the position of a window created in the script?

    Hi all

    A window called from another window are the same size. How to change the position of the window from the window of the appellant's appeal?

    You can also use the property frameLocation of the window to get a set the locations of the windows.

  • How to create an app with automator to execute a bash script?

    I want to create an application like Ds store Remover but it will remove the directories instead of a single file. So I was wondering how can I do to do this, I have a bash script that the code is below, I just need to know what to do. To get the app ask root password and allow the user to select the directory they want these directories.

    sudo rm - rf ".» Thrashes.

    sudo rm - rf ".» Spotlight-V100.

    sudo rm - rf ".» Trash ".

    sudo rm - rf ".» DS_Store '.

    Hello D3ATH2020,

    You must run a 'do shell script' and add 'with administrator privileges. See this technical note from Apple: https://developer.apple.com/library/mac/technotes/tn2065/_index.html

    However, I strongly do not try what you are doing. There are better ways to manage the. DS_Store files. You don't want to remove these other directories. I mean, really, you want to do.

  • Insert a record, call a stored procedure and execute a shell script

    Hello

    I am trying to build a page APEX do these three things in order.

    #1. Insert a new record in a database table (pk, donnees_xml, attr1 and attr2, etc.) and download the XML file to the donnees_xml column

    #2. Save this XML file on a file system

    #3. Parse the XML file on a file system and update the database with the parsed data table

    I can do #1 with a regular shape based on the database table. I can do #2 with a stored procedure.

    I can do #3 with a shell script.

    I wonder how these tasks can be combined into a single action in APEX.

    do #1;

    If successful, do #2;

    If successful, do #3;

    I'd appreciate comments on this.

    Thank you

    Define a process of PL/SQL page submit that runs after the record is inserted, if P1_FILE is not null.

Maybe you are looking for