Renaming a Swatch with a script

I was wondering if it is possible to rename a swatch with a script. In an open document I would like the script to run and do the following:
If swatch Pantone 032 is in the document change the swatch name to 032 (Red).
If swatch Pantone 577 is in the document change the swatch name to 577 (Drain).
I have a list of 35 swatches that if they are in the document I need them renamed.
Anyone offer some help?
Thanks to the community for offering support to guys that struggle with or have no background in coding!

I have done the exact same process as what you are looking for. I got this working:
var SW = app.activeDocument.swatches;
if (SW.length > 0) {
    for (i=0; i < SW.length; i++){   
        changeName(SW[i]);
function changeName(swatchObject){
                if (swatchObject.name == "10 YELLOW"){                       
                    swatchObject.name = "10 yellow";
                if (swatchObject.name == "12 YELLOW"){                       
                    swatchObject.name = "12 yellow";
In this instance, it changed 10 YELLOW and 12 YELLOW to a lowercase name. You would need to go in and type in a conditional statement for each swatch you are wanting to rename.
When the script is ran, it doesnt appear to update the swatch name. However, if you double click on one of the swatches, the name that is showed will be the changed value, and when you hit cancle on that pop-up dialogue, all the others will switch to the new name.
Anybody know if there is a way to update the swatch palette within the script to show the new names automatically?

Similar Messages

  • Changing a Spot Color Swatch with a script

    I have about 150 files where I need to replace a Pantone color with another.
    So far I've been able to rename the old color, delete it and add the right one. But I cant find any info on how to change an existing color without messing up the existing art work (if I rename it, it converts the spot color to CMYK).
    For example I could rename it:
    i if ( app.documents.length > 0 &&
    i app.activeDocument.swatches.length > 0 ) {
    i var lastIndex = app.activeDocument.swatches.length - 1;
    i var lastSwatch = app.activeDocument.swatches[lastIndex];
    i lastSwatch.name = "Pantone 414 C";
    i }
    But that doesn't change it to 414 C. If you have any idea, I would be very grateful...
    Regards Simon

    Why not change it in Illustrator?
    Since you're using Creative Cloud you should be aware that the new
    applications will not install on Windows XP. The minimum configuration
    is Windows 7 SP1 or Windows 8.
    Bob

  • Batch Rename Multiple files with different names

    Hi,
    Is there any way to batch rename multiple files with individual names? I.e
    IMG_123 changed to  RSP45AS
    IMG_124 changed to MOL157A
    IMG_125 changed to AGKH135
    IMG_126 changed to MNOLH13
    IMG_127 changed to ASFBLUG
    Etc.
    Are they any programs or scripts or plug ins that would do that job?
    Thanks

    HI there Onemorewave,
    It looks like there is a batch remname feature included in OS X 10.10 Yosimte if you are planing on updating. 
    Rename files, folders, and disks - Mac Help
    Rename multiple items
    Select the items, then Control-click one of them.
    In the shortcut menu, select Rename Items.
    In the pop-up menu below Rename Folder Items, choose to replace text in the names, add text to the names, or change the name format.
    Replace text: Enter the text you want to remove in the Find field, then enter the text you want to add in the “Replace with” field.
    Add text: Enter the text to you want to add in the field, then choose to add the text before or after the current name.
    Format: Choose a name format for the files, then choose to put the index, counter, or date before or after the name. Enter a name in the Custom Format field, then enter the number you want to start with.
    Click Rename.
    Note: To batch rename, you would want to choose the "Format" option.
    -Griff W

  • Error message with a script sending emails to multiple recipients.

    Hi all,
    I am very new with powershell scripting and I want to request your attention and help on this issue.
    I am getting this error message "Send-MailMessage: An invalid character was found in the mail header: ','" given by this script:
    Param (
    [string]$Path = "C:\Temp\",
    [string]$SMTPServer = "smtp.domain1.com",
    [string]$From = "[email protected]",
    [string[]]$To = "[email protected],[email protected]",
    [string]$Subject = "New backup file"
    $SMTPMessage = @{
    To = $To
    From = $From
    Subject = "$Subject at $Path"
    Smtpserver = $SMTPServer
    $File = Get-ChildItem $Path | Where { $_.LastWriteTime -ge [datetime]::Now.AddHours(-6) }
    If ($File)
    { $SMTPBody = "`nThe following files have recently been added/changed:`n`n"
    $File | ForEach { $SMTPBody += "$($_.FullName)`n" }
    Send-MailMessage @SMTPMessage -Body $SMTPBody
    I found the ForEach() approach but when I put it inside I get an infinite loop.
    Many thanks for any suggestions

    [string[]]$To = "[email protected],[email protected]",
    should be
    [string[]]$To = @("[email protected]","[email protected]")

  • Problem with Java Script after upgrade from BW 3.5 to BI7

    Dear Colleagues,
    We're facing the issue with Java Script after upgrade of BW 3.5 to BI7.
    Just after update we checked the basic functionality and it occured that some of web templates that use Java Script don't work. They generate seelction screen, but after selection the screen becomes blank without any error messages.
    We're currently stucked since web templates weren't converted to BI7 version so they should work exactly as before the upgrade.
    We compared the Java code with other environment that was not upgraded - it's perfectly the same.
    The only explanation that comes to my mind is that some Java Script settings on the server level were changed during the upgrade but I have no idea where I can check that.
    Thanks in advance for any suggestions,
    Andrzej Bobula

    Hi Deepu,
    Thanks, it was great to read your reply and then few minutes later talk to you live on SDN Day!
    Unfortunately, http cache clean-up did not help. But there is another funny thing I found - for exactly the same 3.5 webtemplate html code returned from WebAS 3.5 was different then from 7.0.
    Unfortunately, this editor does not allow to paste complete code, even in CODE brackets, but here are main differences:
    <b>3.5</b>
       if (navigator.appName == "Microsoft Internet Explorer")
    <frame src="/sap/bw/BEx?SAP-LANGUAGE=E&PAGENO=1&REQUEST_NO=1&CMD=GET_TEMPLATE"
    name="Content">
    and
    <b>7.0</b>
       if (navigator.appName.indexOf("Microsoft Internet Explorer")!=-1)
    <frame src="/sap/bw/BEx?SAP-LANGUAGE=E&PAGENO=8&REQUEST_NO=0&CMD=GET_TEMPLATE"
    name="Content" 0nLoad="javascript:loadTitle()">
    (I intentionaly put 0 i/o o in 0nLoad, otherwise Forum's editor does not accept the text.
    How about SAP's claim that technical upgrade from 3.x to 7.0 changes nothing?
    Regards,
    Vitaliy

  • How do I import old FCP projects that have mysteriously changed to Linux Executable files?  Is it as simple as renaming the files with the.fcp extension?

    I had some FCP projects on an old G3 tower that I finally want to finish. I was able to grab everything, media, etc. to my macbook pro but all of the Final Cut Pro actual movies/projects have turned into "linux executable files" that FCP X won't import.
    I tried googling this issue but didn't really see any good answers. Would it be as simple as renaming the files with the .fcp extension?  I can't recall if my old version (really old) of FCP saves projects as .mov or .fcp files, but I'm assuming I'm not the only person this has happened to.
    Thanks for your help!

    I had some FCP projects on an old G3 tower that I finally want to finish.
    What version of FCP was this? The project files can probably no longer be opened in the newer version of the OS. You could try adding the .fcp suffix, but I don't think it will help for this. Projects files are .fcp.
    Regardless of the version, no legacy FCP projects will import into FCPX.
    Media is a different matter. These are probably QuickTime .mov files. If these are appearing as Unix ececutables, they're probably not recoverable either.

  • Need help with a script applied by GPO

    Hello,
    I need to automate WebFeed insertion for Remote App Users at user logon.
    RDS 2012 R2 in place. Remote Apps are provided to W7 clients.
    Currently, WebFeed link must be inserted manually in each user's Control Panel\RemoteApp and Desktop Connections. There
    is no straight forward way from Microsoft.
    But there is a script and instruction I found on web...
    I followed the instruction... Created GPO. GPO applies to user but nothing happens.
    Can somebody check the script and the instruction that I could wrongly applied.
    In instruction there is no word about changing something in the script but only wcx file that the script should
    use.
    The script is below and here is my .wcx file:
    <?xml version="1.0? encoding="utf-8? standalone="yes"?>
    <workspace name="Enterprise Remote Access" xmlns="http://schemas.microsoft.com/ts/2008/09/tswcx" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <defaultFeed url="https://my_webserver_real_FQDN/rdweb/Feed/webfeed.aspx" />
    </workspace>
    I changed the quotes to vertical (") from (”) that
    were in my wcx when copied the lines from web.
    Still not works.
    I
    checked Application log, PowerShell and RemoteApp in eventviewer under user session
    Everything is clean.
    Were I can check the script execution log?
    When the user with applied script logs in, the icon of Remote
    connection appears for 10 seconds on the task bar and disappears.
    Looks like it's trying...
    Check please if the script really should not be touched and provide some troubleshooting
    steps.
    Thanks!
    INSTRUCTIONS from
    the link:
    http://www.concurrency.com/infrastru...rver-2012-rds/
    "Unfortunately
    Windows 7 clients are out of luck here. If you really want to use GPO to deploy
    RemoteApps to Windows 7 clients, then you have to jump through a few
    hoops.
    Create a new GPO and under User ConfigurationPoliciesWindows
    SettingsScripts, double click Logon and click the
    Show Files
    button. This will open an explorer window where you can copy files that will be
    saved within this GPO. Download the
    Install-RADCConnection.ps1 script from the TechNet gallery and
    save it there. Also create a new Text file named something like feed.wcx,
    open it in Notepad and paste in the following three lines of text:
    <?xml
    version=”1.0″ encoding=”utf-8″ standalone=”yes”?>
    <workspace
    name=”Enterprise Remote Access” xmlns=”http://schemas.microsoft.com/ts/2008/09/tswcx”xmlnss=”http://www.w3.org/2001/XMLSchema”>
    <defaultFeed
    url=”https://rds.domain.com/RDWeb/Feed/webfeed.aspx”
    />
    </workspace>
    Now select the PowerShell Scripts tab and
    click the Add button.
    Click Browse and select the .ps1 file and
    for the parameters enter the name of the wcx file. Click OK twice and you are
    ready to scope that policy to a set of users.   
    <#
    .SYNOPSIS
    Installs a connection in RemoteApp and Desktop Connections.
    .DESCRIPTION
    This script uses a RemoteApp and Desktop Connections bootstrap file(a .wcx file) to set up a connection in Windows 7 workstation. No user interaction is required.It sets up a connection only for the current user. Always run the script in the user's session.
    The necessary credentials must be available either as domain credentials or as cached credentials on the local machine. (You can use Cmdkey.exe to cache the credentials.)
    Error status information is saved in event log: (Applications and Services\Microsoft\Windows\RemoteApp and Desktop Connections).
    .Parameter WCXPath
    Specifies the path to the .wcx file
    .Example
    PS C:\> Install-RADCConnection.ps1 c:\test1\work_apps.wcx
    Installs the connection in RemoteApp and Desktop Connections using information
    in the specified .wcx file.
    #>
    Param(
    [parameter(Mandatory=$true,Position=0)]
    [string]
    $WCXPath
    function CheckForConnection
    Param (
    [parameter(Mandatory=$true,Position=0)]
    [string]
    $URL
    [string] $connectionKey = ""
    [bool] $found = $false
    foreach ($connectionKey in get-item 'HKCU:\Software\Microsoft\Workspaces\Feeds\*' 2> $null)
    if ( ($connectionKey | Get-ItemProperty -Name URL).URL -eq $URL)
    $found = $true
    break
    return $found
    # Process the bootstrap file
    [string] $wcxExpanded = [System.Environment]::ExpandEnvironmentVariables($WCXPath)
    [object[]] $wcxPathResults = @(Get-Item $wcxExpanded 2> $null)
    if ($wcxPathResults.Count -eq 0)
    Write-Host @"
    The .wcx file could not be found.
    exit(1)
    if ($wcxPathResults.Count -gt 1)
    Write-Host @"
    Please specify a single .wcx file.
    exit(1)
    [string] $wcxFile = $wcxPathResults[0].FullName
    [xml] $wcxXml = [string]::Join("", (Get-Content -LiteralPath $wcxFile))
    [string] $connectionUrl = $wcxXml.workspace.defaultFeed.url
    if (-not $connectionUrl)
    Write-Host @"
    The .wcx file is not valid.
    exit(1)
    if ((CheckForConnection $connectionUrl))
    Write-Host @"
    The connection in RemoteApp and Desktop Connections already exists.
    exit(1)
    Start-Process -FilePath rundll32.exe -ArgumentList 'tsworkspace,WorkspaceSilentSetup',$wcxFile -NoNewWindow -Wait
    # check for the Connection in the registry
    if ((CheckForConnection $connectionUrl))
    Write-Host @"
    Connection setup succeeded.
    else
    Write-Host @"
    Connection setup failed.
    Consult the event log for failure information:
    (Applications and Services\Microsoft\Windows\RemoteApp and Desktop Connections).
    exit(1)
    --- When you hit a wrong note its the next note that makes it good or bad. --- Miles Davis

    Use GPP for this. Do not use a script.  Post your issues in the GP forum.
    You should also visit the RDS forum to get information on how to distribute remote app links.
    ¯\_(ツ)_/¯

  • What's Wrong With This Script

    A couple of years ago I was using an AppleScript file (thanks to someone else's assistance) but it no longer works.
    I have an extra internal drive, that is partitioned, and used for sequential daily backups. When the computer starts up, of course all the drives mount - but I prefer that they are off the desktop until neded.
    Rather than selecting the volumes and then dragging to the Trash, I found it easier to have a script run at startup which then asks if the drives should be unmounted.
    Things were great - until I upgraded to Tiger.
    I am hoping that someone can tell me what's wrong with the script so that I can start using it again. As you can probably tell, I don't have any experience in AppleScript. At the moment the script runs - it presents the dialogue box - and then just ends after a response, but the drives do not unmount.
    The partitions on the drive are called Monday Tuesday Wednesday Thursday Saturday
    The existing script is as follows:
    on run
    display dialog "Unmount All Backup Drives?" buttons {"Yes", "No"} default button 1
    set x to button returned of result
    if x is "Yes" then tell application "Finder" to eject "Monday"
    end run

    This relates to another (current) thread in AppleScript discussions.
    Your script works with Panther as that operating system allows INTERNAL drives to be "ejected" (and, if you eject one volume on a partitioned drive, all the volumes on that drive are ejected -- this explains why ejecting "Monday" actually ejected Monday through Friday).
    With Tiger, you would find that your script works exactly as expected with EXTERNAL drives, but INTERNAL drives need a different approach.
    To get behavior exactly as you had before, try this script:
    --BEGINNING
    display dialog "Unmount All Backup Drives?" buttons {"Yes", "No"} default button 1
    set x to button returned of result
    if x is "Yes" then set driveName to "Monday"
    set driveInfo to do shell script "diskutil list | grep \"" & driveName & "\""
    set driveID to last word of driveInfo
    do shell script "diskutil unmountDisk " & driveID & ""
    --END
    For reasons that aren't entirely clear to me, this approach, while it works reliably, is very slow -- on my fast machine, the unmount process takes nearly 20 seconds. (Using UNIX directly in Terminal, with the same command, is very quick.) (In the AS, the delay occurs in second "do shell script.")
    Another puzzle that has cropped up is described in the related thread "Applescript to Mount/Unmount a Disk . . ." (current). While the above approach works for Justin Surpless, it often prompts for a password -- unacceptable in his application. I've not seen this on my PPC (and I tried 10.4.7, which he's using); his may be an Intel Mac, if that could be the difference.

  • Change Page size with a Script

    I have made artwork in Illustrator that is set up as two page spreads on 1 artboard.
    I need to convert this to single page spreads.
    I.e. So for half the documents, I need to set the anchor point of the document to top left and half the width of the artboard.
    For the other half of the documents, I need to set anchor point to to right and half the width.
    Is this possible with scripting?
    I have look around online to find ways of accessing the document size and anchor point via scripting, but cannot seem to find any resources.
    Thanks for any help that can be offered.
    Edit: Also is it possible to create a new artboard with a script and assign it a name?

    here you go, this script splits the artboard in two
    // carlos canto
    // http://forums.adobe.com/message/5380624#5380624
    var idoc = app.activeDocument;
    var ab = idoc.artboards[0];
    var abBounds = ab.artboardRect;// left, top, right, bottom
    var ableft = abBounds[0]; // 0
    var abtop = abBounds[1]; // 612
    var abright = abBounds[2];
    var abbottom = abBounds[3];
    var abwidth = abright - ableft; // 792 // width
    var abheight = abtop- abbottom; // 0 // height
    var half = ableft + abwidth/2;
    var abright2 = half;
    ab.artboardRect = [ableft, abtop, abright2, abbottom];
    var ableft2 = half;
    var newAB = idoc.artboards.add([ableft2, abtop, abright, abbottom]);

  • How to install adobe flash player through command line with some script

    Hi Guys,
    Do you know how to install adobe flash player through command line with some script?
    Thanks,
    Galina

    Windows. I tried silent install  with "install_flash_player.exe /install" but it works only with one file that I downloaded from adobe.com - "install_flashplayer10_mssd_aih.exe". But it is possible to download this last file only one time, every next time it redirects me to download install_flash_player.exe file.

  • How to make a selection of a layer delete content and paste another content with Photoshop scripting..?

    how to make a selection of a layer delete content and paste another content with Photoshop scripting..?

    There is a more specific Forum …
    Photoshop Scripting

  • NEED a java coder to help with a script for a programs of mine.

    I play a game, very competitively, and need someone to make and compile a script for me. I am willing to pay upwards of 100 USD for this script made to MY standards. There will be a lot of work involved...Probably 12 hours studying my game and the purpose of the script(s). I will be buying 2-3 scripts, at roughly 50-100 USD each, depending on the quality. I will transfer the money via paypal, or other means if we can reach an agreement.
    Please IM me at Chadtrapier on AIM or send an email to [email protected]
    Or...Add me on MSN - [email protected]
    We can reach an agreement with these scripts...
    Thank you, I will also check this thread, so reply if you would like.
    ~Chad

    Ummm. Do you think that's a lot of money or something? Think in the range of 40-60 per hour. And if you're talking about warcraft I don't think they java hooks to make bots. I think you need to figure out what your problem is first and maybe learn to code them yourself.

  • Changing SPRM 0 with a script ?

    Hi list,
    In have searched the archives but I did not found an answer or solution: Is there any way you can change SPRM 0 (menue language) with a script ???
    Any help would be great, Michael

    Hi Chris,
    let me first distinguish between a normal menue and a "language menue" which is a menue that is automatically created when you add a second language to the project. Lets say we have got English an Spanish as languages - so in the menue tab you have the option to choose between english and spanish. Now in the scripts I find no way to adress a menue according to it´s language. I can adress the main menue - but wether in english or spanish is no available option. Only choice would be to build a completly seperat menue called "main menue spanish" - okay, I could do that - but what reason is left there for the "language menues" - as nobody sets the DVD player correctly anyway?
    But maybe I miss the point - you say "select the correct language based on the users previous selection" - how exactly would you do that? I have stored the users choice in GRPM 0 (eng=0, span=1) and it does change the audiostream and subtitels like expected - how do I change the language ??
    michael

  • Indesign document read with Extend Script

    Hi, I am very new to indesign,
    I have given a task, to read indesign .indd file with Extend Script. The details are,
    I have one indesign doument, say 'Test.indd'. I want to access that document usiing javascript,
    and I want to know how many pages are there, how many textFrames in one page, like this.
    Is it possible with Extend Script? If yes, Can you tell me how we can acheive that?
    I searched with google, bt I have not found any clue regarding to this
    Thanks,
    Shridhar

    It's better to ask at Indesign Scripting forum
    http://forums.adobe.com/community/indesign/indesign_scripting?view=discussions

  • Pdf reader X has problems with small pdf and printer with post script driver

    Hi friends.
    I have installed new Reader X and then i saw that, when i print a very small pdf with about 50 kb and i print it on a Laserjet 4000 printer the printer has problem with the amount of data that reader 10 produces.
    When i install a Postscript driver for the printer my computer makes up to 3.5MB printer data from a 50kb pdf.
    When i install a PCL driver for the printer my computer makes only 350kb from the same 50kb pdf file!!!!
    When i install Reader 9.3 the 50kb file becomes also only 350kb on the printer with post script driver, and i can print without problems also.
    my printer has 8 MB Ram and that should be enough for 3.5MB printer data.
    But when i print the pdf with 1 side only, the printer created a side who is only filled with 50% of the text, then there comes out a second page with the message.....not enough memory in the printer.
    i can not change the postscript driver to a pcl driver cause our ERP System can not handle printer with PCL drivers.
    Can someone help me please.........are there settings in Reader X who can solve my problem ???
    Thank you very much for help!

    put ? after rwcgi60.exe

Maybe you are looking for