How to check if a specific file exist and which exit code to use ?

Hi, First I'm not a scripting guy and I know almost nothing about VB scripting.
I have a deployment of 6 tasks and I want to make sure that step # 2 will not be process if it failed in step #1, and so on for the 6 task.
To do this, i have to run a vb script before installation or uninstalltion on each steps
I'm trying to use a script (not from me) that i have modified for pre-uninstallation of software and also post-installation of the software.
Pre-uninstallation: The script will look if the specified "exe" exist on the server and if so, than it will run the msiuninstall "application_name".
If the uninstallation is successful, the post-installation script will check if the "exe" file exist again on the server, and it shouldn't find it (because it was deleted from the uninstallation), than it will return an exit code of successful
to run the next process.
Here an example:
Step 1: Uninstall "Software#1" with msiuninstall Software#1.exe command
Step 2: Uninstall "Software#2" with msiuninstall Software#2.exe command
Step 3: Install "Software #3"with an .exe extension
Step 4: Re install "Software #2" with an .msi extension
Step 5: Re install "Software #1" with a .msi extension.
Step 6: Send email to confirm the deployment is successful
So i need to validate that step #2 will not process step #3 if it failled on # 2. It need to validate if the file exist before and after.
At the end, Step 6 should send an email to confirm that the 6 steps of the deployment was completed without errors.
Any idea how to do it ?
Many many thanks for all the help !
A desperate guy :)
This is what i have
'This script will look if an .exe file exist for a specific application.
'=============================================================================================
path = WScript.Arguments.Item(0)
set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(C:\Inetpub\wwwroot\Enterprise\EnterpriseWS\web.config) = true then
    exitCode = 0
else
    exitCode = 1
End If
Wscript.Quit exitCode

Since you are not a scripting guy here is a very good place to start:
http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx
¯\_(ツ)_/¯

Similar Messages

  • Checking List of Specific Files exists in Folder

    Hi all,
    Please  help and advice
    business promises that they drop 10 Different Files with TimeStamp.
    1. QHP_Group_Association_Benefit_Periods_20140117104957
    2. QHP_Out_Of_Pocket_Limit_20140117110805
    10.QHP_Strategy_20140117110230
    I have a requirement where I have to start SSIS process Only if all 10 files are available. If any file is missing Dont start any process.
    Please help me How to check all files needed are available in a Folder using SSIS?
    Thanks
    Kodi

    I would perform this task by using a Script Task the System.IO classes. The task would have access to an SSIS variable that was the directory path. The task would get a listing of the files in the directory. Another Boolean package variable would be set
    to True if all ten file where present. A conditional expression on the workflow using this Boolean variable would control whether execution continued or not.

  • [SOLVED] How to start JACK with KDE 4? (and which JACK should I use?)

    Hi again
    I'm using KDE 4, and I've just installed JACK again, and since I can't find any decent documentation on this, I'm having a bit of a problem.
    Currently I have jack from [extra] installed, rather than jack2. When I try starting jack as the ArchWiki suggests, i.e. by typing "jackd -d alsa", I get the following error:
    $ jackd -d alsa
    jackd 0.120.1
    Copyright 2001-2009 Paul Davis, Stephane Letz, Jack O'Quinn, Torben Hohn and others.
    jackd comes with ABSOLUTELY NO WARRANTY
    This is free software, and you are welcome to redistribute it
    under certain conditions; see the file COPYING for details
    could not open driver .so '/usr/lib/jack/jack_firewire.so': libffado.so.2: cannot open shared object file: No such file or directory
    JACK compiled with System V SHM support.
    loading driver ..
    creating alsa driver ... hw:0|hw:0|1024|2|48000|0|0|nomon|swmeter|-|32bit
    control device hw:0
    the playback device "hw:0" is already in use. Please stop the application using it and run JACK again
    cannot load driver module alsa
    I've also tried jack2 from [community], and after starting it with "jack_control start", I get this...
    $ jack_control start
    --- start
    DBus exception: org.jackaudio.Error.Generic: Failed to start server
    So how do I start it? I'm guessing jack doesn't want to start because some other KDE application grabbed alsa before jackd (but I've been wrong before), and I don't have the slightest idea what jack2 is about with that "generic" error. If anyone would help me shed some light on this, I'd appreciate it a lot.
    Thanks in advance!
    Last edited by Wintershade (2011-03-26 19:22:08)

    @schivmeister thanks that one worked
    Yes, it was knotify4. So now this part works. I've switched to jack2 and it works flawlessly when starting it with jackd
    So this part is solved... now, would you be so kind (if you know) as to point me to some tutorials or howtos (or proper documentation, cos I can't find much of that either) on how to connect various ALSA channels with JACK?
    Basically, I want to route my PCM channel and the Mic channel into Capture 1 (or one to Capture 1 and other to Capture 2), since my Intel HDA audio card doesn't have the "Mix" or "What-U-Hear" or whatever as an available capture source. Any leads on that? (or do I have to open another thread for it?)
    TIA

  • How do I find out what program / file is using 100 GB of space on my Hard drive?  Once I find the problem  how do I delete the specific files to increase GB of space?

    How do I find out what program / file is using 100 GB of space on my Hard drive?  Once I find the problem  how do I delete the specific files to increase GB of space?

    Use OmniDiskSweeper
    Once you find file, it can be deleted from within OmniDiskSweeper
    Allan

  • A how-To guide about splitting import files exists?

    Hi All,
    in his Webinar https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/409e4529-adbc-2a10-4d9b-e8fade570414
    Klaus David said a "A how-To guide about splitting import files exists" (Page 20).
    Can anybody tell me where to find this guide?
    Please mail to becker.roman ( at ) web . de
    Best regards
    Roman

    I found the link here, if you are still looking.
    I didnot check the contents yet but the title says
    MDM 5.5 SP06 - IT Scenario Configuration Guide -
    https://websmp202.sap-ag.de/~sapidb/011000358700001119482007E
    Thanks
    Satya

  • Utl_file.open_file question to check if a file exists and is not empty

    Hello,
    I am trying to write a code where in 3 seperate files are created based on some parameter condition for the extract call.
    Say the parameters are NULL, 'A' and 'B'.
    When Null condition is passed to the extract call then it should create file A and B if records are found. If not it should create empty files.
    It is possible that the parameter to the extract is just 'A' then it would create A with say non zero file and B with zero file.
    Now when the extract is called with 'B' parameter and if the file A already exists and is not empty then I should not touch/overwrite it with empty records.
    Is there any simple way that I can do this to check if a file exists and is non empty?
    I am using
    open_file
    ( gv_utl_file_path
    ,lv_file_name
    ,lv_file_handle
    Please help.
    Thanks

    @OP : No Need to open
    SQL> declare
      2   lb_file_exist boolean;
      3   ln_size number;
      4   ln_block_size number;
      5  begin
      6   sys.utl_file.fgetattr('TEST_DIR','a.txt',lb_file_exist,ln_size,ln_block_size);
      7   if lb_file_exist then
      8    dbms_output.put_line('a Exists');
      9    dbms_output.put_line(to_char(ln_size));
    10   else
    11    dbms_output.put_line('a Not Exists');
    12   end if;
    13   sys.utl_file.fgetattr('TEST_DIR','b.txt',lb_file_exist,ln_size,ln_block_size);
    14   if lb_file_exist then
    15    dbms_output.put_line('b Exists');
    16    dbms_output.put_line(to_char(ln_size));
    17   else
    18    dbms_output.put_line('b Not Exists');
    19   end if;
    20   sys.utl_file.fgetattr('TEST_DIR','c.txt',lb_file_exist,ln_size,ln_block_size);
    21   if lb_file_exist then
    22    dbms_output.put_line('c Exists');
    23    dbms_output.put_line(to_char(ln_size));
    24   else
    25    dbms_output.put_line('c Not Exists');
    26   end if;
    27  end;
    28  /
    a Exists
    0
    b Exists
    3
    c Not Exists
    PL/SQL procedure successfully completed.Edited by: jeneesh on Mar 30, 2012 1:21 AM

  • Dialog prompt and check if file exists, and use the result of dialog

    I have this working script and I want to change the way it behaves.
    I want a dialog to come up, Do you want to skip or replace existing files.
    Then the result  of the dialog to be used in the reast of the script.
    I've added it in the script where I need to use it. in noce big letters, hopefully its not a big job.
    Many thanks
    property type_list : {"8BPS"}
    property extension_list : {"psd"}
    script o
              property theseNames : {}
    end script
    -- empty log file
    do shell script "echo  'Files not processed in Photoshop :'  > ~/Desktop/LogPhotoshopError.txt"
    set noError to true
    --Setup list of folders and process details of folders
    set dtF to paragraphs of (do shell script "ls -F ~/Desktop | grep '/' | cut -d'/' -f1")
    set tc to (count dtF)
    repeat with i from 1 to tc
              set folderName to item i of dtF --<:  is the folder name, no need to use text item delimiters -->":"
              if folderName does not start with "2_" and folderName does not start with "Hot" and folderName does not start with "Press" and folderName does not start with "Design" and folderName does not start with "Keywords" and folderName does not start with "Season" and folderName does not start with "Sue" and folderName does not start with "Design" then
                        set {oldTID, my text item delimiters} to {my text item delimiters, "_WK"}
                        set FolderEndName to last text item of folderName
                        set brandName to first text item of folderName
                        set my text item delimiters to "_PSD"
                        set weekNumber to first text item of FolderEndName
                        set my text item delimiters to oldTID
                        set theFolder to ("Hal 9000:Users:matthew:Desktop:" & folderName)
      --set up names to destination folders and create locally based on brand name and week number
                        set this_local_folder to "Images:2012-2013"
                        set localWeekFolder to my getFolderPath("WK" & weekNumber, this_local_folder)
                        set localBrandFolder to my getFolderPath(brandName, localWeekFolder)
                        set localBrandFolder_Low_Res to my getFolderPath(brandName & "_WK" & weekNumber & "_LR", localBrandFolder)
                        set localBrandFolder_High_Res to my getFolderPath(brandName & "_WK" & weekNumber & "_HR", localBrandFolder)
                        set localBrandFolder_PSD to my getFolderPath(brandName & "_WK" & weekNumber & "_PSD", localBrandFolder)
                        set this_Network_folder to "GEN:Brands:Zoom:Brand - Zoom:Upload Photos:2013:"
                        set networkWeekFolder to my getFolderPath("Week" & weekNumber, this_Network_folder)
                        set networkBrandFolder_Low_Res to my getFolderPath(brandName & "_WK" & weekNumber & "_LR", networkWeekFolder)
                        set website_images to "GEN:Website_Images:"
      --set up names to destination folders and create over Netwrok for FTP collection (based on a mounted drive)
                        set this_ftp_folder to "pulse:"
                        set ftpWeekFolder to my getFolderPath("Week" & weekNumber, this_ftp_folder)
                        set ftpBrandFolder to my getFolderPath(brandName, ftpWeekFolder)
                        set ftpBrandFolder_Low_Res to my getFolderPath(brandName & "_WK" & weekNumber & "_LR", ftpBrandFolder)
                        set ftpBrandFolder_High_Res to my getFolderPath(brandName & "_WK" & weekNumber & "_HR", ftpBrandFolder)
      --at the beginning of the script, ask whether to replace or skip existing files? to apply to all?
      --use the result for the if file exists?
                        display dialog "Should I replace or skip exisiting files?" buttons {"Replace", "Skip (Faster)"} default button 2 with icon 1
      --taking the folder identify which process it must follow.
                        if brandName is equal to "BH" then
                                  try
                                            tell application "Finder" to set o's theseNames to (name of files of alias theFolder whose file type is in the type_list or name extension is in the extension_list)
                                  on error
                                            set o's theseNames to {} -- no psd files or "8BPS"
                                  end try
                                  set numOfNames to (count o's theseNames)
                                  repeat with j from 1 to numOfNames
                                            set thefile to theFolder & ":" & (item j of o's theseNames)
      --    B H   Folder Photoshop Process
      --if thefile exists in the folder localBrandFolder_PSD then do the result of dialog.
      --"Skip" the file and move on to next
      --If "replace" continue the rest of the script.
                                            tell application "Adobe Photoshop CS5.1"
      -- I remove the command activate, Photoshop stay in background
                                                      set ruler units of settings to pixel units
                                                      try
      open (alias thefile) showing dialogs never
                                                                set origName to name of current document
                                                                set myOptions to {class:JPEG save options, quality:12}
                                                                set myPSDOptions to {class:Photoshop save options, embed color profile:true, save layers:true}
                                                                tell current document
      --If the quick mask mode has been left on then delete the channel Quick Mask
                                                                          if (quick mask mode) then delete channel ¬
                                                                                    "Quick Mask"
      --If the Layer is incorrectly labeled with Original Layer it needs renaming to original Image
                                                                          if (exists layer "Original Layer") then ¬
                                                                                    tell layer "Original Layer" to set name to "Original Image"
      save in (localBrandFolder_PSD & origName) as Photoshop format with options myPSDOptions without copying
                                                                          (delete layer "Original Image") flatten
      resize image resolution 300 resample method none
      --sharpen image
      filter current layer using unsharp mask with options {amount:80, radius:3.2, threshold:0}
      save in (localBrandFolder_High_Res & name) as JPEG with options myOptions without copying
      --get file path, return path of the JPEG file, work with (without copying)
      -- (with copying) : it return path of PSD file
                                                                          set newFile to file path --( return path of type alias )
      -- duplicate file using the Finder  -->on duplicateFile(..)
                                                                          my duplicateFile(newFile, {ftpBrandFolder_High_Res})
      --Prepare for Low RES by resetting image history
                                                                          set current history state to history state 3
                                                                          flatten
                                                                          resize image width 1348
      resize image resolution 300 resample method none
      filter current layer using unsharp mask with options {amount:80, radius:3.2, threshold:0}
      --add save to lowResFolder with same options
      save in (localBrandFolder_Low_Res & name) as JPEG with options myOptions without copying
                                                                          set newFile to file path
                                                                          set newFile2 to newFile as string -- for testing end of name
                                                                          if newFile2 ends with "_2.jpg" or newFile2 ends with "_3.jpg" then -- exclude website_images
                                                                                    my duplicateFile(newFile, {networkBrandFolder_Low_Res, ftpBrandFolder_Low_Res})
                                                                          else
                                                                                    my duplicateFile(newFile, {networkBrandFolder_Low_Res, ftpBrandFolder_Low_Res, website_images})
                                                                          end if
      close saving no
                                                                end tell
                                                      on error
                                                                set noError to false
                                                                my myLogs(thefile) -- write path to log file in Desktop
                                                                try
      close saving no --if exists, close current document
                                                                end try
                                                      end try
                                            end tell
                                  end repeat
      --End BH
    -- else if and the rest of the script.....
    end repeat
    if not noError then do shell script "/usr/bin/open  ~/Desktop/LogPhotoshopError.txt'"
    on myLogs(t)
              try
                        do shell script "echo " & (quoted form of t) & ">> ~/Desktop/LogPhotoshopError.txt'"
              end try
    end myLogs
    on duplicateFile(tFile, foldersPath) -- tFile is an alias, foldersPath is a list of folder
              tell application "Finder" to repeat with folderPath in foldersPath
                        with timeout of 200 seconds -- adjust it,  error if the copy  is longer that 200 seconds
      duplicate tFile to folder folderPath with replacing
                        end timeout
              end repeat
    end duplicateFile
    on getFolderPath(tName, folderPath)
              tell application "Finder" to tell folder folderPath
                        if not (exists folder tName) then
                                  return (make new folder at it with properties {name:tName}) as string
                        else
                                  return (folder tName) as string
                        end if
              end tell
    end getFolderPath
    tell application "Finder"
              open "Hal 9000:Users:matthew:Desktop:LogPhotoshopError.txt"
    end tell

    Hi,
    I think that's what you want.
    I put the dialog in the beginning, so it does not appear to each folder, otherwise put it in the loop as it was originally.
    property type_list : {"8BPS"}
    property extension_list : {"psd"}
    script o
          property theseNames : {}
    end script
    -- empty log file
    do shell script "echo  'Files not processed in Photoshop :'  > ~/Desktop/LogPhotoshopError.txt"
    set noError to true
    --at the beginning of the script, ask whether to replace or skip existing files? to apply to all?
    --use the result for the if file exists?
    display dialog "Should I replace or skip exisiting files?" buttons {"Replace", "Skip (Faster)"} default button 2 with icon 1
    set skipFiles to (button returned of the result) is "Skip (Faster)"
    --Setup list of folders and process details of folders
    set dtF to paragraphs of (do shell script "ls -F ~/Desktop | grep '/' | cut -d'/' -f1")
    set tc to (count dtF)
    repeat with i from 1 to tc
          set folderName to item i of dtF --<:  is the folder name, no need to use text item delimiters -->":"
          if folderName does not start with "2_" and folderName does not start with "Hot" and folderName does not start with "Press" and folderName does not start with "Design" and folderName does not start with "Keywords" and folderName does not start with "Season" and folderName does not start with "Sue" and folderName does not start with "Design" then
                set {oldTID, my text item delimiters} to {my text item delimiters, "_WK"}
                set FolderEndName to last text item of folderName
                set brandName to first text item of folderName
                set my text item delimiters to "_PSD"
                set weekNumber to first text item of FolderEndName
                set my text item delimiters to oldTID
                set theFolder to ("Hal 9000:Users:matthew:Desktop:" & folderName)
                --set up names to destination folders and create locally based on brand name and week number
                set this_local_folder to "Images:2012-2013"
                set localWeekFolder to my getFolderPath("WK" & weekNumber, this_local_folder)
                set localBrandFolder to my getFolderPath(brandName, localWeekFolder)
                set localBrandFolder_Low_Res to my getFolderPath(brandName & "_WK" & weekNumber & "_LR", localBrandFolder)
                set localBrandFolder_High_Res to my getFolderPath(brandName & "_WK" & weekNumber & "_HR", localBrandFolder)
                set localBrandFolder_PSD to my getFolderPath(brandName & "_WK" & weekNumber & "_PSD", localBrandFolder)
                set this_Network_folder to "GEN:Brands:Zoom:Brand - Zoom:Upload Photos:2013:"
                set networkWeekFolder to my getFolderPath("Week" & weekNumber, this_Network_folder)
                set networkBrandFolder_Low_Res to my getFolderPath(brandName & "_WK" & weekNumber & "_LR", networkWeekFolder)
                set website_images to "GEN:Website_Images:"
                --set up names to destination folders and create over Netwrok for FTP collection (based on a mounted drive)
                set this_ftp_folder to "pulse:"
                set ftpWeekFolder to my getFolderPath("Week" & weekNumber, this_ftp_folder)
                set ftpBrandFolder to my getFolderPath(brandName, ftpWeekFolder)
                set ftpBrandFolder_Low_Res to my getFolderPath(brandName & "_WK" & weekNumber & "_LR", ftpBrandFolder)
                set ftpBrandFolder_High_Res to my getFolderPath(brandName & "_WK" & weekNumber & "_HR", ftpBrandFolder)
                --taking the folder identify which process it must follow.
                if brandName is equal to "BH" then
                      try
                            tell application "Finder" to set o's theseNames to (name of files of alias theFolder whose file type is in the type_list or name extension is in the extension_list)
                      on error
                            set o's theseNames to {} -- no psd files or "8BPS"
                      end try
                      set numOfNames to (count o's theseNames)
                      repeat with j from 1 to numOfNames
                            set thefile to theFolder & ":" & (item j of o's theseNames)
                            --    B H   Folder Photoshop Process
                            tell application "Finder" to set b to exists file (localBrandFolder_PSD & item j of o's theseNames)
                            if b and not skipFiles then -- file exists and "replace" (continue the rest of the script).
                                  tell application "Adobe Photoshop CS5.1"
                                        -- I remove the command activate, Photoshop stay in background
                                        set ruler units of settings to pixel units
                                        try
                                              open (alias thefile) showing dialogs never
                                              set origName to name of current document
                                              set myOptions to {class:JPEG save options, quality:12}
                                              set myPSDOptions to {class:Photoshop save options, embed color profile:true, save layers:true}
                                              tell current document
                                                    --If the quick mask mode has been left on then delete the channel Quick Mask
                                                    if (quick mask mode) then delete channel ¬
                                                          "Quick Mask"
                                                    --If the Layer is incorrectly labeled with Original Layer it needs renaming to original Image
                                                    if (exists layer "Original Layer") then ¬
                                                          tell layer "Original Layer" to set name to "Original Image"
                                                    save in (localBrandFolder_PSD & origName) as Photoshop format with options myPSDOptions without copying
                                                    (delete layer "Original Image") flatten
                                                    resize image resolution 300 resample method none
                                                    --sharpen image
                                                    filter current layer using unsharp mask with options {amount:80, radius:3.2, threshold:0}
                                                    save in (localBrandFolder_High_Res & name) as JPEG with options myOptions without copying
                                                    --get file path, return path of the JPEG file, work with (without copying)
                                                    -- (with copying) : it return path of PSD file
                                                    set newFile to file path --( return path of type alias )
                                                    -- duplicate file using the Finder  -->on duplicateFile(..)
                                                    my duplicateFile(newFile, {ftpBrandFolder_High_Res})
                                                    --Prepare for Low RES by resetting image history
                                                    set current history state to history state 3
                                                    flatten
                                                    resize image width 1348
                                                    resize image resolution 300 resample method none
                                                    filter current layer using unsharp mask with options {amount:80, radius:3.2, threshold:0}
                                                    --add save to lowResFolder with same options
                                                    save in (localBrandFolder_Low_Res & name) as JPEG with options myOptions without copying
                                                    set newFile to file path
                                                    set newFile2 to newFile as string -- for testing end of name
                                                    if newFile2 ends with "_2.jpg" or newFile2 ends with "_3.jpg" then -- exclude website_images
                                                          my duplicateFile(newFile, {networkBrandFolder_Low_Res, ftpBrandFolder_Low_Res})
                                                    else
                                                          my duplicateFile(newFile, {networkBrandFolder_Low_Res, ftpBrandFolder_Low_Res, website_images})
                                                    end if
                                                    close saving no
                                              end tell
                                        on error
                                              set noError to false
                                              my myLogs(thefile) -- write path to log file in Desktop
                                              try
                                                    close saving no --if exists, close current document
                                              end try
                                        end try
                                  end tell
                            end if -- else "Skip" the file and move on to next
                      end repeat
                      --End BH
                end if
          end if
    end repeat
    if not noError then do shell script "/usr/bin/open  ~/Desktop/LogPhotoshopError.txt'"
    on myLogs(t)
          try
                do shell script "echo " & (quoted form of t) & ">> ~/Desktop/LogPhotoshopError.txt'"
          end try
    end myLogs
    on duplicateFile(tFile, foldersPath) -- tFile is an alias, foldersPath is a list of folder
          tell application "Finder" to repeat with folderPath in foldersPath
                with timeout of 200 seconds -- adjust it,  error if the copy  is longer that 200 seconds
                      duplicate tFile to folder folderPath with replacing
                end timeout
          end repeat
    end duplicateFile
    on getFolderPath(tName, folderPath)
          tell application "Finder" to tell folder folderPath
                if not (exists folder tName) then
                      return (make new folder at it with properties {name:tName}) as string
                else
                      return (folder tName) as string
                end if
          end tell
    end getFolderPath
    tell application "Finder"
          open "Hal 9000:Users:matthew:Desktop:LogPhotoshopError.txt"
    end tell

  • Search if a layersets with a specific name exist and execute a function if it is the case

    Hello,
    How can i write a script that search if a layersets with a specific name exist and execute a function if it is the case?
    Some examples?
    Many thanks.
    Regards.
    Sebastien

    This would check for a LayerSet if a name with DOM code – so it’s fairly slow.
    var check = checkForLayersetNamed(app.activeDocument, false, "thisName");
    alert (check);
    ////// function collect all layers //////
    function checkForLayersetNamed (theParent, theCheck, theName) {
    /* if (!allLayers) {var allLayers = new Array}
      else {};*/
      for (var m = theParent.layers.length - 1; m >= 0;m--) {
      var theLayer = theParent.layers[m];
    // apply the function to layersets;
      if (theLayer.typename == "ArtLayer") {
    // allLayers.push(theLayer)
      else {
      if (theLayer.name == theName) {theCheck = true};
      theCheck = (checkForLayersetNamed(theLayer, theCheck, theName))
    // allLayers.push(theLayer);
      return theCheck
    Below is AM code Paul Riggott posted some time ago in connection with linking Layer Masks.
    Re: Automatically re-link layer masks
    You could add a check for whether the Layer is a LayerSet, but if the name is the sole distinguishing feature this might work as a basis for your operations.
    app.bringToFront();
    main();
    function main(){
    if(!documents.length) return;
    linkLayers();
    function linkLayers(){
       var ref = new ActionReference();
       ref.putEnumerated( charIDToTypeID('Dcmn'), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
       var count = executeActionGet(ref).getInteger(charIDToTypeID('NmbL')) +1;
       var Names=[];
    try{
        activeDocument.backgroundLayer;
    var i = 0; }catch(e){ var i = 1; };
       for(i;i<count;i++){
           if(i == 0) continue;
            ref = new ActionReference();
            ref.putIndex( charIDToTypeID( 'Lyr ' ), i );
            var desc = executeActionGet(ref);
            var layerName = desc.getString(charIDToTypeID( 'Nm  ' ));
            var Id = desc.getInteger(stringIDToTypeID( 'layerID' ));
            if(layerName.match(/^<\/Layer group/) ) continue;
    /* you could insert your operations in an if clause here */

  • Adobe Illustrator CS4 Error: Error 1603. Error 1305.Error reading from file C:\Program Files\Adobe\Adobe Illustrator CS4\Support Files\Required\Fonts\AdobeSongStd-Light.otf.  Verify that the file exists and that you can access it.  AdobeColorCommonSetRGB

    Iam trying to load illustator in my PC i get following error while loading Application CD 2
    Adobe Illustrator CS4
    Error:
    Error 1603. Error 1305.Error reading from file C:\Program Files\Adobe\Adobe Illustrator CS4\Support Files\Required\Fonts\AdobeSongStd-Light.otf. Verify that the file exists and that you can access it.
    AdobeColorCommonSetRGB
    Error:
    Error 2.
    My serial no. [Removed by moderator]

    Download a copy an installer for CS4 from the links on this page:
    Other downloads

  • IPhone4 how through the USB mobile phone file reading and writing?

    iPhone4 how through the USB mobile phone file reading and writing?

    No idea what you are asking.
    Please explain

  • How can I find the specific channel name and modify channel name in automatically in VBS?

    How can I find the specific channel name and modify channel name in automatically in VBS? (DIAdem 9.1)
    I would like to change channel name = "speed01" ... "speed10"  to  channel name = "velocity01"..."velocity10.
    martino

    Hello Martino,
    this script will help:
    Option Explicit
    Dim i
    Dim n
    For i=1 To 10
    If i < 10 then
    n = CNo("speed0" & i)
    Else
    n = CNo("speed" & i)
    End If
    If n > 0 Then
    If i < 10 then
    ChnName(n) = "velocitiy0" & i
    Else
    ChnName(n) = "velocitiy" & i
    End If
    End If
    Next
    Matthias
    Matthias Alleweldt
    Project Engineer / Projektingenieur
    Twigeater?  

  • I want to convert a pdf file into xml.Which programme should I use and how do I access it?

    I want to convert a pdf file into xml.Which programme should I use and how do I access it?I am based in India.

    Hello,
    if you create your doc files by the help of WORD, you could use a Microsoft add on (it depends of your WORD Version).
    Hans-Günter

  • How to set cookie value in one page and retrieve in another page using setA

    How to set cookie value in one page and retrieve in another page using setActionListener?
    I have tried with following code srcpage.jspx->destpage.jspx
    srcpage.jspx
    <af:table value="#{bindings.DepartmentsView1.collectionModel}"
    var="emp" rows="#{bindings.EMPView1.rangeSize}"
    first="#{bindings.EMPView1.rangeStart}"
    emptyText="#{bindings.DepartmentsView1.viewable ? 'No rows yet.' : 'Access Denied.'}">
    <af:column sortProperty="EmployeeName" sortable="false"
    headerText="Cookie Testing">
    <af:commandLink text="#{emp.EmployeeName}" action="success">
    <af:setActionListener from="#{emp.EmployeeName}"
    to="#{cookie}"/>
    </af:commandLink>
    </af:column>
    </af:table>
    espage.jspx
    <af:outputText value="Test Cookie Value: #{cookie}"/>
    ,Here Test Cookie Value prints the following instead of its original String value
    {JSESSIONID=javax.servlet.http.Cookie@7da288, oracle.uix=javax.servlet.http.Cookie@399f62}
    I have passed employee name "Robert" to cookie in srcpage.jspx,but it prints "JSESSIONID....." instead of "Robert" in destpage.jspx
    Thanks in advance
    Kalee

    Hi,
    "cookie" is a reserved name. If you want to write to a session scope attribute called "cookie" then you have to call #{sessionScope.cookie}. If you want to use EL to set and read from cookies then you will have to use
    #{cookie.cookieName}
    Note that #{cookie} writes to and returns a map
    check this: http://www.informit.com/articles/article.aspx?p=30946&seqNum=7
    Frank

  • How can I purchase an iTunes card online and get the code online to purchase apps.

    How can I purchase an iTunes card online and get the code online to purchase apps.

    iTunes Gift Options
    http://support.apple.com/kb/HT2736

  • How can I create a custom formula that checks if a PC file exists? (CR10)

    Post Author: lgayosso
    CA Forum: Formula
    Hello,
    I need to create a formula that validates whether a PC file exists or not to display a message ('File Found' or 'File not found'). I created a custom formula that displays the appropriate message based on a report field composed of the FilePath + FileNameWithExtension that works correctly if the field includes a value or not (Basic Syntax below):
    If {ctDocumentImages.ImgPath} <> ""  Then    Formula = "File Found"Else    Formula = "File not found"End If
    Now I want to validate that the {ctDocumentImages.ImgPath} value corresponds to an existing file; that is, I need to check that the file specified at {ctDocumentImages.ImgPath} location truly exists to determine that the file is actually 'found'. How can I accomplish this?
    Any help is greatly appreciated,
    Lucio

    Post Author: lgayosso
    CA Forum: Formula
    [email protected]:
    ( my file connection name was CrystalReports_Reports.File Name)  I have generated a report, that shows all my rpt file names, size, last updated.... etc )
    Go to database expert, create new connection, select file system data, your starting directory will be
    genplex\E\JEMS51_Server\Imaging\Int\2007\.....  you can then report on the file names found in that directory / subdirectory, etc...  When creating the link you can select all files, or just *.rpt  for example
    Ok, so you define more than one connection on your report to be able to access the File System Object, right? The problem is that my reports are generic and meant for distribution for customers where no generic base folder will exist. The value of the starting directoy is then unknown, FilePath+Name then can be any value.
    Lucio

Maybe you are looking for