We need a script that will select clipping path for multiple images in indesign

this is what we have, but it's not working:
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll; 
app.doScript(resetAllClippingPathsToActiveDoc, ScriptLanguage.JAVASCRIPT, [], UndoModes.ENTIRE_SCRIPT, "Reset all Clipping Paths of the Active Document"); 
function resetAllClippingPathsToActiveDoc(){ 
    var d=app.activeDocument; 
    var allGraphicsInDoc = d.allGraphics; 
    for(var n=0;n<allGraphicsInDoc.length;n++){ 
        if(allGraphicsInDoc[n].hasOwnProperty("clippingPath")){allGraphicsInDoc[n].clippingPath.c lippingType = ClippingPathType.PHOTOSHOP_PATH};
            allGraphicsInDoc[n].clippingPath.appliedPathName = "Path 1"; 

this is what we have, but it's not working:
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll; 
app.doScript(resetAllClippingPathsToActiveDoc, ScriptLanguage.JAVASCRIPT, [], UndoModes.ENTIRE_SCRIPT, "Reset all Clipping Paths of the Active Document"); 
function resetAllClippingPathsToActiveDoc(){ 
    var d=app.activeDocument; 
    var allGraphicsInDoc = d.allGraphics; 
    for(var n=0;n<allGraphicsInDoc.length;n++){ 
        if(allGraphicsInDoc[n].hasOwnProperty("clippingPath")){allGraphicsInDoc[n].clippingPath.c lippingType = ClippingPathType.PHOTOSHOP_PATH};
            allGraphicsInDoc[n].clippingPath.appliedPathName = "Path 1"; 

Similar Messages

  • I need a script that will find the computer a user last logged into.

    I am still learning scripting, I need a script that will allow me to pull in usernames from a csv file. Find what computer they last logged into and output that to an csv file.
    I have looked all over and can't find exactly what I need.
     I found the following script but I need  to add the resuitsize unlimited but can not figure out where to put it we have a large environment. Also I need to be able to grab username from a csv file. Any assistance you can provide is appreciated.
    ##  Find out what computers a user is logged into on your domain by running the script
    ##  and entering in the requested logon id for the user.
    ##  This script requires the free Quest ActiveRoles Management Shell for Active Directory
    ##  snapin  http://www.quest.com/powershell/activeroles-server.aspx
    Add-PSSnapin Quest.ActiveRoles.ADManagement -ErrorAction SilentlyContinue
    $ErrorActionPreference = "SilentlyContinue"
    # Retrieve Username to search for, error checks to make sure the username
    # is not blank and that it exists in Active Directory
    Function Get-Username {
    $Global:Username = Read-Host "Enter username you want to search for"
    if ($Username -eq $null){
    Write-Host "Username cannot be blank, please re-enter username!!!!!"
    Get-Username}
    $UserCheck = Get-QADUser -SamAccountName $Username
    if ($UserCheck -eq $null){
    Write-Host "Invalid username, please verify this is the logon id for the account"
    Get-Username}
    get-username resultsize unlimited
    $computers = Get-QADComputer | where {$_.accountisdisabled -eq $false}
    foreach ($comp in $computers)
    $Computer = $comp.Name
    $ping = new-object System.Net.NetworkInformation.Ping
      $Reply = $null
      $Reply = $ping.send($Computer)
      if($Reply.status -like 'Success'){
    #Get explorer.exe processes
    $proc = gwmi win32_process -computer $Computer -Filter "Name = 'explorer.exe'"
    #Search collection of processes for username
    ForEach ($p in $proc) {
    $temp = ($p.GetOwner()).User
    if ($temp -eq $Username){
    write-host "$Username is logged on $Computer"

    If you are querying by user "resultset size" will be of no use.
    You also have functions that are never used and the body code doe snot look for users.
    Here is what you scrip looks like if printed well.  It is just a jumble of pasted together and unrelated items.
    ## Find out what computers a user is logged into on your domain by running the script
    ## and entering in the requested logon id for the user.
    ## This script requires the free Quest ActiveRoles Management Shell for Active Directory
    ## snapin http://www.quest.com/powershell/activeroles-server.aspx
    Add-PSSnapin Quest.ActiveRoles.ADManagement -ErrorAction SilentlyContinue
    $ErrorActionPreference = "SilentlyContinue"
    # Retrieve Username to search for, error checks to make sure the username
    # is not blank and that it exists in Active Directory
    Function Get-Username {
    $Global:Username = Read-Host "Enter username you want to search for"
    if ($Username -eq $null) {
    Write-Host "Username cannot be blank, please re-enter username!!!!!"
    Get-Username
    $UserCheck = Get-QADUser -SamAccountName $Username
    if ($UserCheck -eq $null) {
    Write-Host "Invalid username, please verify this is the logon id for the account"
    Get-Username
    get-username resultsize unlimited
    $computers = Get-QADComputer | where { $_.accountisdisabled -eq $false }
    foreach ($comp in $computers) {
    $Computer = $comp.Name
    $ping = new-object System.Net.NetworkInformation.Ping
    $Reply = $null
    $Reply = $ping.send($Computer)
    if ($Reply.status -like 'Success') {
    #Get explorer.exe processes
    $proc = gwmi win32_process -computer $Computer -Filter "Name = 'explorer.exe'"
    #Search collection of processes for username
    ForEach ($p in $proc) {
    $temp = ($p.GetOwner()).User
    if ($temp -eq $Username) {
    write-host "$Username is logged on $Computer"
    I suggest finding the original code then use the learning link at the top of this page to help you understand how it works in Powershell.
    ¯\_(ツ)_/¯

  • Need a script that will put photo on white background

    I am currently using CS3 Photoshop on a MacPro Intel
    I have about 31,000 photos that I need to take the background out of. Most of the photos were not shot against white, black or green screens. These are mostly images of plumbing products. The majority of these images do have clipping paths. I am currently having to manually select the path, make selection, select inverse, cut the selection, save, close. I have tried to create a script to do this, but haven’t been successful in doing so yet. I have been able to create basic scripts in the past without issues, but this one has me stumped. Any help or direction would be greatly appreciated.

    As long as the files do have clipping paths this should get you started. It applies the clipping path as a vector mask. All you should have to add is the save and close part. If you need help with that let me know what format you want to save and the save options.
    // apply clipping path as vector mask
    var clipPathIndex = clippingPathIndex();
    if( clipPathIndex != -1 ){
         activeDocument.layers[ activeDocument.layers.length -1 ].name = 'Converted Background';// rename bottom layer incase isBackground
         activeDocument.pathItems[ clipPathIndex ].select();
         createVectorMask();
         activeDocument.pathItems[ clipPathIndex ].deselect();
         // or
         //activeDocument.pathItems[ clipPathIndex ].remove();
    // Function: clippingPathIndex
    // Description: Gets the index of the activeDocument's clipping path
    // Usage: clippingPathIndex()
    // Input: None
    // Return: Index as Integer. -1 if there is no clipping path
    function clippingPathIndex(){
         var ref = new ActionReference();
              ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
         var desc = executeActionGet( ref );
         var clippingPath =  desc.getObjectValue(charIDToTypeID("Clpg"));
         return  clippingPath.getInteger(charIDToTypeID("ClpI" ));
    // Function:  createVectorMask
    // Description: Make vector mask from active path
    // Usage: createVectorMask();
    // Input: None
    // Return: -1 if failed
    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; }

  • Need a powershell script that will modify the path of an existing Outlook 2010 OST file

    For new users we have a GPO in place that creates the OST file in the correct location.  The GPO also works on existing users who create a new Outlook Profile.
    The problem I am trying to solve is modifying an existing Outlook Profile and changing the location that the OST file is written to.
    I have to put the users OST file on the network.  Yes, I do know that this is not supported by Microsoft, but I have zero clients (WYSE units) on non-persistent VMware virtual machines.  This means they cannot keep the OST file on the PC. 
    Our email provider requires us to run in Cached-Mode so OST files are here to stay.
    Forcing 3000 users to create new Outlook profiles would not have a good outcome.
    I also have to relocate their PST files onto the network, which is also not supported.  I have been able to connect PST's with powershell, but disconnecting them has been challenging (can't make it work even once) so if I could get some help with that
    too that would be excellent.
    Thanks

    Hi,
    You may refer to the following article to create the registry keys and deploy it with logon script:
    http://www.slipstick.com/exchange/moving-outlook-ost-file/
    Best regards,
    Rex Zhang
    TechNet Community Support

  • Need a Script that will count different codes and enter in another field

    I am using ES2,  I have a form which users enter codes (50 different codes) in a code field.  I need for the corresponding toatl box for each code to increase by 1 for each time the corresponding code is entered.  Have just started using ES2 and any help would be welcome.
    TY

    I am using ES2,  I have a form which users enter codes (50 different codes) in a code field.  I need for the corresponding toatl box for each code to increase by 1 for each time the corresponding code is entered.  Have just started using ES2 and any help would be welcome.
    TY

  • Script that will help validate if there is any data loss after a DB restore

    Hi,
    I need to write a single script that will perform the following
    operations:
    1)return me the highy accessed tables across all databases.
    2)List the count, Min and Max system date of the highy accessed tables returned from step 1.
    The idea is to validate if there is any data loss to the highly transactional tables after a database restore operation has been performed.
    Thanks.

    Hello,
    I would also like you to see nice blog by Aron,you can modify the script a bit to change according to your need
    http://sqlblog.com/blogs/aaron_bertrand/archive/2008/05/06/when-was-my-database-table-last-accessed.aspx
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers
    Hello Shanky,
    The post would not be helpful too much for OP's requirement. The post was talking about when was the database last accessed. DMLs are not capturing in the script and also there will be many variant forms that can be applied for DML. Hence, I do not think,
    the script would help too much. 
    Or Am I missing something? 
    Latheesh as i mentioed OP has to modify the script little bit may be add User_seek,user_update,user_scans.Still IMO there is no *perfect* way to actually analyze this.So I pointed out point in my original post.Also unless he has some timestamp he cannot
    see min time when it was accessed ,max time can be taken from last user seek,scan,lookup time. Motive was to lethim know what he was trying to achieve cannot be axactly obtained by using sys.dm_index_usage_stats.Below query will give most accessed table
    : Source (Query)
    SELECT
    t.name AS 'Table',
    SUM(i.user_seeks + i.user_scans + i.user_lookups)
    AS 'Total accesses',
    SUM(i.user_seeks) AS 'Seeks',
    SUM(i.user_scans) AS 'Scans',
    SUM(i.user_lookups) AS 'Lookups'
    FROM
    sys.dm_db_index_usage_stats i RIGHT OUTER JOIN
    sys.tables t ON (t.object_id = i.object_id)
    GROUP BY
    i.object_id,
    t.name
    ORDER BY [Total accesses] DESC
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • I need a script that copies the filename into the file

    I need a script that copies the filename into 4th column of each line in the text doc file.
    I have over 2000 different file names each containing 6 columns and ~50-100 rows.
    I can do this manually using this script:
    awk '{print $1"\t"$2"t\"$3"\t <name> \t"$6}'
    But I would like an automation command or script. Is there any command that I can use instead of <name> that will copy the filename into the column?
    Thanks
    Monica

    Oops, I forgot the redirect to a file. It's not a good idea to edit files in place. A script could fail and you're left with at least one file ruined. It's better to create new files then delete the old files.
    for file in *; do
        while read col1 col2 col3 col4 col5 col6; do              
            printf "%s\t%s\t%s\t%s\t%s\n" $col1 $col2 $col3 $file $col6
        done < $file > n$file
    done
    You could narrow the files listed such as
    for file in *.tsv
    and redirect the new files to another directory. Such as
    done < $file > /absolute/path/to/directory/$file

  • IDCS6(MAC) 10.9.4 - a script that will make an anchored object and paste in clipboard contents

    I'm trying to create a script that will create an anchored object that will paste in clipboard contents.
    So far I have:
    var frameRef = app.selection[0];
        var parentObj = frameRef.insertionPoints.item(0);
        var anchorFrame = parentObj.rectangles.add();
    And this works fine, creating an inline object, that can further be defined (with anchor point settings etc).
    However, it is when I go to use app.paste() or app.pasteInto() that all hell breaks loose.
    The line of code I added was:
    anchorFrame.content = app.pasteInto();
    and the error I get is:
    What am I doing incorrectly?
    Colin

    @Colin – For the paste command you like to use, you have to:
    1. First select an object, in your case the added rectangle object
    2. Then use the pasteInto() method from the app object
    3. There is no content property for a rectangle object
    Watch out what is selected after you added the rectangle.
    What you have is a selection of the text frame when you start your code in line one.
    Adding a rectangle will not change that selection.
    The following code will do the job.
    However, if you use pasteInto() the pasted objects could be only partly visible inside the frame.
    Depends on the size and position of the added rectangle relative to the original copied page items.
    Make sure that you give the rectangle a proper size after or while you are adding it:
    var frameRef = app.selection[0];
    var parentObj = frameRef.insertionPoints.item(0);
    //Will add a rectangle sized 40 x 40 mm
    var anchorFrame = parentObj.rectangles.add({geometricBounds:[0,0,"40mm","40mm"]});
    app.select(null); //Optional
    app.select(anchorFrame);
    app.pasteInto();
    Uwe

  • Magic wand tool that will select broken-line shapes?

    I'm an illustrator... working in both digital & real artwork.
    I work mostly in Photoshop CS, but I have been searching for a solution to a digital problem that I can't quite seem to find using either Photoshop or Illustrator.
    What I wish to do is scan a pencil drawing and then create selected shapes in a quick and easy method using a magic wand tool.
    But it needs to be a magic wand tool that will select an area drawn from a series of broken lines. Photoshop will only select shapes that are 100% intact, so I wind up having to spend lots of time searching to repair broken lines before Photoshop selects just that one area.
    I KNOW that such a program exists... because I recall there used to be such a program. It was a free dowloaded program that I got once, way back around 1998. I think it came from Australia... and it was a basic digital paint program of some sort. I can't recall the name.
    It allowed one to quickly click and select an area from within a shape drawn with broken line segments...
    Does anyone know of any program (hopefully for Mac) that allow this sort of selection?
    This would save me hours of frustration. I can't believe Adobe hasn't come up with something like this already.
    Thanks...
    John Nez
    www.johnnez.com

    Gerno
    I doubt that I will get to trying the proposed method on that sample image this weekend. I can make a few quick comments, however.
    Like numerous Photoshop tools, the success of Illustrator tools like Live Trace and Live Paint are very image dependent and some experience helps. Here are some comment on the three steps needed.
    First, the Live Trace step must be done well. There are a boat load of parameters for this process. For the subject image my guess would be to start with a preset and the one I would choose would be comic art.
    Secondly, once you make a live paint group you have to have automatic gap detection checked (turned on) and you choice of predefined or custom gap sizes specified. You will then see where the gaps are automatically found and fixed and the gap options dialog box will tell you how many have been found. If you like what you see you can just start painting. Usually, however it is an iterative process of painting some of the areas and then resetting the gap detection and painting again. At any point you can automatically close the paths (but you cannot go back), change the settings to auto detect even larger gaps and try again.
    Third is the manual phase. If lucky you will have none of this. On the subject image, however, I can see that some of this is required. To preserve the artistic content of the original one draws a line in the very big gaps having no stroke or fill (invisible line)and then you use the live paint bucket. While the above sounds like a lot of work, it can go very quickly with many drawings.
    JN
    >That's why I think Adobe ought to work on designing a 'smart magic wand tool'... that could select imperfectly closed shapes.
    The Live Paint tool in Illustrator does this. It automatically detects gaps and lets you paint as if they were not there.
    Paulo

  • I need a function that will go through and encrypt all the strings

    I want to use one way enryption and need a function that will
    go through and encrypt all the strings in my password column in sql
    server 2003.
    I also need a function that compares a test password string
    is equal to the hash value in the database. Can anyone give me some
    advice in this?

    Apparently it's not as simple as I thought. My first instinct
    was
    update yourtable set password = '#hash(password)#'
    but that will crash
    This is inefficient, but you only have to do it once.
    query1
    select id, password thepassword
    from yourtable
    cfloop query="query1"
    update yourtable
    set password = '#hash(thepassword)#'
    where id = #id#

  • "A script that will delete perfstat snapshots older than 90 days with SPPURGE..."

    Hello to all my fine Oracle related friends...We are all one large extended Family...
    I want to create a script that will execute SPPURGE on Perfstat for snapshots that are older than 90 days.
    Now, I have Grid 12c Cloud Control up and running for all the Databases that we have...
    Should I use Grid 12c to execute the SPPURGE and just pass the parameters in like that?
    Or should I go "Old School" and make a Shell Script and schedule it in the crontab?
    What would you guys do?
    I want implement this for 41 "Standard Edition" Databases....some are "Data Guard".....
    Thanks,
    Xevv.

    Xevv Bellringer wrote:
    Hi Ed,
    I tried executing this manually and it's not deleting the snapshots at all.
    begin
    statspack.purge(trunc(sysdate-90),true);
    end;
    I even let it for an entire day and then altered the code like this...But when I execute it, it doesn't deleted the data..
    begin
    statspack.purge(trunc(sysdate-1),true);
    end;
    When I do a select sysdate -1 from dual; it gives the correct date?
    Could there be a "NLS Setting" some where causing this?
    How do you determine that it is not deleteding data?  (please show evidence)
    How, and how often, are you collecting a statspack snapshot?  (please show evidence)

  • In need of a report that will list all vendors for all parts in our plant.

    Can anyone tell me if there is a report in SAP that we can use to list all suppliers for a given material? We are operating in SAP ECC6.0 and need a report that will list all vendors that the company has used for a given part. Is there a standard report in SAP that pulls information from purchasing info records?  Woud this be  a custom report?     I have tried using MCE3. 
    Also does anybody know of any SAP consultants that can help us create custom reports

    For the list of vendors for the material - Me03 if source list is maintained
    For list of vendors with info record - Me1m
    For list of vendors with PO - Me2l
    If you can give the correct requirements then your Technical consultant will develop a report in the required format.

  • I need an application that will turn off my iPhone on the home screen just by a one click since my power button has sank and is no longer working--anyone have ideas?? I don't like having to use assistive touch and hit three buttons to lock my screen

    I need an application that will turn off my iPhone on the home screen just by a one click since my power button has sank and is no longer working--anyone have ideas?? I don't like having to use assistive touch and hit three buttons to lock my screen

    No such app exisits or can exist.  Apple doesn't allow 3rd party apps to access core functions of the phone.  Time to get your phone replaced or repaired if assistive touch doesn't needs your needs.

  • Looking for a script that will find broken links

    I create long documents in InDesign, and I often have 50-75 Indesign documents in my InDesign book. Because what I do is production publishing, at any one time I'll have a half dozen similar books under construction. All the books contain the same chapters (as far as file name an basic content). I need a script that I can run on the final PDF for each project to make sure that all of my hyperlinks/cross references are intact. This is to ensure that I didn't accidentally link to a chapter from a different project. In other words, I need to make sure that my final PDF contains both the source and the destination.
    Does anyone know where I can find a script like this?
    Thanks,
    Kelly Vaughn

    A script can't do that. Maybe a plugin.

  • I need an app that will play one song from a list then pause

    I currently use a DJ style CD player to play backing tracks for the trio that I play with. The CD player has a "single" button that when you engage it will only play one song from the CD and then stop/pause. I need an app that will do the same thing as it relates to a playlist. Any ideas?

    It isn't an answer to your actual question but it might help:
    Try creating a playlist in iTunes with that one song you need to be played. Start that playlist (ipod app) and you'll see that your ipad will only play that song.

Maybe you are looking for

  • HT201263 ipod charger exploded and the itouch does not turn on and is not recognized by windows or itunes

    connected the charger and after about 5 seconds the charger exploded with a bang and you could smell burnt circuits and the screen went black and hasn't started since then..

  • Problem with car subwoofer amplifier

    My daughter bought a complete car audio system.  The amp on the subwoofer doesn't work and the geek squad stated that the amp was defective and that the manufacturers warranty would cover a new replacement.  Long story short...one salesman told my da

  • Control File Help

    Hi, Require Help in SQL Loader Control File : There is a field (column) called customer line number assuming we are uploading from excel sheet , if that value is null then it should use an sequence to upload in the format of 1,2,3. Kindly do help in

  • Multiple images not opening in tabs CS3

    I have an old mac computer that I use for display for clients that has cs3 but when I opened photoshop the images are not displayed in tabs.  I have been to Windows>arrange but the only options I have are cascade tile horizontal tile vertical the pre

  • HT5624 I forget the answers of my securities question ,can you help please?

    I really want to change my password because somebody else it's using and I can not change it because I forget the answer of securities questions ,help me please