[JS] How do you set change GREP preferences to a custom color swatch?

Hi All
I am having difficulty with setting the 'changeGrepPreferences' to a specific color swatch in an InDesign CS3 document.
The code below is meant to search within text styled with the Character Style "Hyperlink" and change any spaces (which import from Word as black text, i.e. have a black underscore) to the font color of the Character Style (which is a spot color that I've named 'Hyperlinks grey'). I think I have cracked it except for the changeGrepPreferences line; but I'll let the experts be the judge of that.
app.findGrepPreferences = null;
app.changeGrepPreferences = null;
app.findGrepPreferences.appliedCharacterStyle = 'Hyperlink';
app.findGrepPreferences.fillColor = 'Black';
app.findGrepPreferences.findWhat = ' ';
app.changeGrepPreferences.fillColor = app.activeDocument.swatches.itemByName('Hyperlinks grey');
app.changeGrepPreferences.changeTo = '$0';
app.activeDocument.changeGrep();
Any help will be greatly received.
Simon

Hi Ole
Thanks for the quick response. Your workaround works well up to a point. However, because the color 'Hyperlinks grey' already exists in the document I'm working on, when you add a new swatch it creates 'Hyperlinks grey 2'. I really need the text to be colored with the original color: in our production workflow we use a system called Odystar to create a Web and a Print PDF. For a print PDF, Odystar first looks for text in the spot color 'Hyperlinks grey' and turns it to black and removes the underscore. It means that hyperlinks look like hyperlinks for a Web PDF, but not for a print PDF.
Also, the line of code that removes the created color only works if no replacements were made. When replacements have been made Hyperlinks grey 2 stays in the swatch. And if you ran the script again in which a replacement was made, it would make Hyperlinks grey 3 etc etc.
So... do you have any further tricks up your sleeve?
Thanks again for you help so far.
With kind regards
Simon

Similar Messages

  • How do you set/change the default alarm TYPE in iCal?

    I like to think I'm a power user, but this one I just can't figure out.  The question/problem is: How do you sent the default alarm TYPE in iCal?  The problem is illustrated in the picture below in the blue circled area.
    Specifically, whenever I set a new event in iCal, it defaults to this window with the default alert being "Default (1 hour before)."  The one hour before is fine, but the problem is, WHAT is the default?  It seems to be just a sound, but that's not good enough to actually alert me of anything.
    The goal I'm trying to achieve with this post is to determine how to CHANGE the "default" new event alert FROM "Default (1 hour before)" TO one of two alerts that I actually find useful:  I want MY "default" new event alert to be either "email" to the primary address, OR, "Message with Sound". 
    Any ideas, folks?  Thanks.

    Understand.  I am in the edit mode for my contact.  I see all the contact info.  There is no right click or other means to change the DEFAULT address that autofill uses (it also is first to appear if I type my name in an e-mail). For instance for a group e-mail you can change the default addresses of each contact by control-clicking on the group in Address Book. I can't seem to make the default change in my v-card.

  • How can you set ink limit preferences in preflight?

    I'm using InDesign CS4 and starting to like the new Preflight panel, but now want it to check my ink limits. I have a printer that wants no more than a 275 on coated stock and no more than 225 on uncoated. Thus I'd like to set up a profile for each so InDesign checks for it in Preflight, basically so I don't forget! I know I can set this on the 'Ink Limit' panel, but unless I remember to check it, it goes unnoticed were as if it was in preflight it would remind me.
    Does this make sense?
    Can anyone help?
    Thanks.
    -Kim

    kimberment wrote:
    It is a cheap printing place, with fast turn around, hence using less ink.
    The Golden Rule of printing: there is Fast, there is Cheap, there is Good. If you are lucky you'll find someone who can do two of the three at the same time, but never all three.
    Are you really saving any time or money by having to jump through all these hoops to provide files this guy can print? Do you even care what your output looks like -- that's a major way potential clients judge you?

  • How do you set a defalut theme(in this case, the theme is HiFi) so each time the computer starts, you do not to have to constantly change it??

    How do you set a default theme(in this case, the theme is HiFi) so each time the computer starts, you do not to have to constantly change it??

    for some reason the function never get's called. I have this
    MyComboBox.dropdown.addEventListener(ToolTipEvent.TOOL_TIP_SHOW,
    myListener);
    and ive tried this:
    MyComboBox.addEventListener(ToolTipEvent.TOOL_TIP_SHOW,
    myListener);
    private function myListener (e:ToolTipEvent) : void {
    trace("e: " + e.target);
    trace("e: " + e.toolTip);
    Any more ideas?

  • How do you set the default magnification for Acrobat.  All documents that I open enlarge to 174% and are too big.

    How do you set the default magnification for Acrobat.  All documents that I open enlarge to 174% and are too big.  I see how to change the size after the document is open by going to File/properties/initial view and saving this setting.  I want all documents to open at 100% when they are first opened.  Can I set this as a default view?

    Hey Kris,
    You might go to Edit> Preferences> Zoom
    Do this without opening any particular PDF so that it applies to the program itself and not just one document.
    Try this and then let me know.
    Regards,
    Anubha

  • HOW DO YOU SET DOCUMENT PROFILE UNDER COLOR MANAGEMENT IN CS4?

    When I try to print in CS4
    (File>Print>Color Management
    >Document(it displays sRGB IEC61966
    -2.1)
    I need to change this to Adobe RGB1998 and I cannot find out how to do this!
    If I go to >EDIT>COLOR SETTINGS the Working Space shows Adobe RGB 1998. Is this what the above "Document" setting should be?
    Please help!
    Dan

    I told you how to set a document profile.
    You set your working preference.  That may have combined with the policies you have set and the processes you follow to get your document into the Adobe RGB color space.
    In any case, I'm glad you have things the way you like them.
    -Noel

  • How do you set up Port Forwarding for ARD 2.2 in AEB N?

    Help,
    I'm a novice at Apple Remote Desktop (ARD) - not an IT guy, so it has to be pretty basic and detailed.
    How do you set up Port Forwarding for ARD 2.2 on the Apple Airport Extreme BS router, 802.11 N. I have one at each end of the internet connection. At one end I have an Airport Extreme N router with 2 macs and eventually 1 windows XP machine (if I can) that I would like to be able to connect to over the interenet (the clients) and at the other end, I have a Mac with ARD 2.2 installed also with an Airport Extreme N router. Note: Both routers use Static IP addresses and all computers use static IP's internally not through DHCP. What are the settings or directions to do this.
    I have read and printed out the directions for Configuration of ARD 3.0 that are posted many times in the ARD discusion group, but it uses a Linksys router ( http://www.starkpr.com/ard.htm posted by Dave Sawyer). The Mac router is different, particularly with the place to set a Private IP address. I'm not sure about alot of things, but especially about the Private IP address, what number do I set it to, the one that is in my Network connections list? It automatically changes to a different number in AE N setup for Port Forwarding (by one) as if it is not suppose to the same?????
    Are there any directions available that are as straight forward for the Airport Extreme N router, as the one's that are listed here for the Linksys Router's? ( http://www.starkpr.com/ard.htm )
    Any and All help will be greatly appreciated.
    P.S. I know I should have 3.0 but bought 2.2 just weeks before 3.0 came out and they would not give me an upgrade price, so I'm waiting for 4.0 to upgrade.
    Thanks,
    Jim

    Try the following for each AirPort Extreme ...
    AEBSn - Port Mapping Setup
    To setup port mapping on an 802.11n AirPort Extreme Base Station (AEBSn), either connect to the AEBSn's wireless network or temporarily connect directly, using an Ethernet cable, to one of the LAN port of the AEBSn, and then use the AirPort Utility, in Manual Setup, to make these settings:
    1. Reserve a DHCP-provided IP address for the host device.
    Internet > DHCP tab
    o On the DHCP tab, click the "+" (Add) button to enter DHCP Reservations.
    o Description: <enter the desired description of the host device>
    o Reserve address by: MAC Address
    o Click Continue.
    o MAC Address: <enter the MAC (what Apple calls Ethernet ID if you are using wired or AirPort ID if wireless) hardware address of the host computer>
    o IPv4 Address: <enter the desired IP address>
    o Click Done.
    2. Setup Port Mapping on the AEBSn.
    Advanced > Port Mapping tab
    o Click the "+" (Add) button
    o Service: <choose the appropriate service from the Service pop-up menu>
    o Public UDP Port(s): 3283
    o Public TCP Port(s): 3283
    o Private IP Address: <enter the IP address of the host server>
    o Private UDP Port(s): 3283
    o Private TCP Port(s): 3283
    o Click "Continue"
    o Click the "+" (Add) button
    o Service: <choose the appropriate service from the Service pop-up menu>
    o Public UDP Port(s):
    o Public TCP Port(s): 5900
    o Private IP Address: <enter the IP address of the host server>
    o Private UDP Port(s):
    o Private TCP Port(s): 5900
    o Click "Continue"
    o Click the "+" (Add) button
    o Service: <choose the appropriate service from the Service pop-up menu>
    o Public UDP Port(s):
    o Public TCP Port(s): 5988
    o Private IP Address: <enter the IP address of the host server>
    o Private UDP Port(s):
    o Private TCP Port(s): 5988
    o Click "Continue"
    (ref: "Well Known" TCP and UDP ports used by Apple software products)

  • How do you set the font color for a specific entire row inside a JTable?

    How do you set the font color for a specific entire row inside a JTable?
    I want to change the font color for only a couple of rows inside a JTable.
    I've seen some ways to possibly do this with an individual cell.
    Clarification on changing the font color in an individual cell would be helpful too if
    there is no easy way to do this for a row.

    hai,
    Try out with this piece of code.Create your table and assign the renderer to each column in the table.
    CellColorRenderer m_CellColorRenderer = new CellColorRenderer();
    for(int i=0;i<your_JTable.getColumnCount();i++)
    your_JTable.getColumnModel().getColumn(i).setCellRenderer(m_CellColorRenderer);
    class CellColorRenderer extends JLabel implements TableCellRenderer
    CellColorRenderer()     
    setOpaque(true);     
    setHorizontalAlignment(LEFT);
    setVerticalAlignment(CENTER);
    setBackground(Color.white);
    setForeground(Color.black);
    protected void setValue(Object value)
         setText((value == null) ? "" : value.toString());
    public Component getTableCellRendererComponent(JTable table,Object value,boolean isSelected, boolean hasFocus, int row,int column)
         if(isSelected == true)
              setForeground(Color.red);
         else
              setForeground(Color.black);
         setValue(value);
         return this;
    regards,
    bala

  • How do you set up Communication between QuickBooks & Acrobat Pro X

    How do you Set up your Acrobat Pro X Pdf Form to communicate with Intuit QuickBooks 10?  Is there special formatting that is involved or is all in the field names?  I have a detailed form that I would like to import the data into Quick Books but I seem to be running in circles and not a straight line.  Can you help me in this matter?
    Thank you in advance - Badgeteam

    Hi,
    We don't have Quickbooks, however having had a look here are some comments:
    Acrobat (for Windows) has some Quickbook templates, which are already set up with a data connection to Quickbooks.
    You should use these, as their structure is set up for you.
    If you open Acrobat, there is an option for Quickbooks from the Forms menu.
    When you select a template, you will be prompted to open this in LiveCycle Designer.
    Once in LC Designer you can examine the objects and their binding (Object > Binding palette).
    You will also notice that there is a script objects "QuickBooks" under variables in the hierarchy. It is highly unlikely that you will need to change anything here, I am just highlighting that it exists and again that it is better to use one of the templates.
    As I don't have Quickbooks, I can't be of much help. There is more information available here:
    http://help.adobe.com/en_US/Acrobat/9.0/3D/WS4E66C448-C5F3-444c-ACE4-778DE09A30B5.html
    Good luck,
    Niall

  • How do you set up the passkey between the Mac & Palm?

    Hi all,
    I need help with a couple of things relating to bluetooth and Mac;
    a) when I try to HotSync the Palm TX and iBook(OS 10.3.9) using BT, I get an error message saying "can't initiate Hotsync because port is in use by another application'.
    b) how do you set up the passkey between the Mac & Palm? I can't work out how to input anything on the Palm at the step where it asks for the passkey.
    thanks
    iBook 1.2GHz   Mac OS X (10.3.9)  

    Palm has this to say about the issue:
    'Unable to initiate HotSync operation because the port is in use by another application.'
    This error can occur on the Palm™ Zire™ 72 handheld after setting up a Bluetooth® HotSync® connection. When you configure the Bluetooth application on the handheld for synchronization (or when you set up a Bluetooth connection in the Connections preference screen), the HotSync button in the Writing Area may try to launch a Bluetooth connection, regardless of the connection selected in the HotSync application on your handheld. The HotSync icon in the Writing Area will always try to connect using whatever method was last used. When you set up Bluetooth HotSync, it used Bluetooth, and now tapping the icon in the Writing Area will result in a Bluetooth connection.
    The issue arises if you launch the HotSync application on your handheld, and select the "Cradle/Cable" option from the pulldown menu, and then tap on the HotSync icon in the Writing Area. Your handheld will still try to perform a Bluetooth HotSync operation, because that was the method last used. You will see an error message, and won't be able to synchronize.
    Unable to initiate HotSync operation because the port is in use by another application.
    Why does this happen?
    Because your handheld was set up for Bluetooth, tapping the HotSync icon in the Writing Area should launch a Bluetooth HotSync. But if you select a different method in the HotSync application, your handheld will try to connect using that method as well. The HotSync application is unsure which method to use, and you will see the error message.
    What should I do?
    If you see this error, here's how to correct the issue:
    1. Launch the HotSync application on your handheld.
    2. In the pulldown menu at the center of the screen, choose the connection method by which you wish to synchronize.
    3. Then, instead of tapping the HotSync icon in the Writing Area, tap the large onscreen HotSync icon in the middle of the HotSync application screen.
    4. Do this every time you wish to synchronize using Cable/Cradle.
    5. Whenever you want to synchronize using Bluetooth, exit the HotSync application and tap the HotSync icon in the Writing Area.
    6. This will allow you to keep multiple connection methods for synchronization, and the flexibility of alternating between them.
    For more information on such issues, perform a keyword search here, in the Palm Macintosh Support area:
    http://www.palm.com/us/support/macintosh

  • How do you set the duration for multiple stills in iMovie 2013?

    How do you set the duration for multiple stills in iMovie 2013?
    Before upgrading to the latest version of iMovie last month, I was able to set the duation of all of the stills included in an iMovie project at one time by clicking the apply to all still box in the adjustment pop up. That option is no longer apparent. If it is available I cannot find it, and I have tried several different ways to accomplish it. I have tried the iMovie help section and can find nothing to help.
    Apple, do I really have to adjust close to 500 pictures to a 5 second duration individually???
    REALLY??!!

    ...why wouldnt people want that level of accuracy when animating, especially when working to music at a specific duration?
    Because often people are animating to words or beats in the music.  Music is rarely performed with a computer-precise beat and tempo.  Musicians aren't robots: they swing the beat sometimes.  They use rubato.  They change tempo.  They change time signatures.  As a result, you have to FIND those words and beats.  It's not a situation where you can say, "There!  I've found the duration of one beat!  Now it's easy to find the rest of them!" 
    If you try it, you will be very disappointed.
    Try finding the precise end of a piece of music that fades or ends on a big chord with a ring-out.  You'll see that it's trial-and-error: what's the point where it becomes inaudible?  It depends on how high your speakers are turned up.  You might have them way up, you set an end point for the layer, and then you do a RAM Preview at a more reasonable volume.  You might say, "Hey!  The music ends before the layer ends!"...  but you KNOW you set the layer's out point when the audio file goes silent.
    AE has layer markers that can be used on an audio layer to mark beats, words, etc. They come in very handy.
    I guess it comes down to this: because AE can do so much different stuff, there are very few automated procedures.  Oh, Adobe tries with effects that convert audio levels to keyframes, but they're not 100% reliable... especially on something like a capella choral works.  For true accuracy, you need  find the timings yourself. 
    If you want something simpler, try a different application. But be prepared for lower level of accuracy.

  • Simple/silly question: how do I set/change default font/color for outgoing mail messages?

    Simple/silly question: how do I set/change default font/color for outgoing mail messages?

    Just a suggestion..........
    Download Thunderbird.  Easier to use when it comes to what you want to do w/your emails. 

  • How do you set the zoom level to Inherit Zoom for all bookmarks in a pdf?

    How do you set the zoom level to Inherit Zoom for all bookmarks in a pdf?

    beatngu13
    I made an account just to "like" your comment and say that you are a god among men.
    I've been searching for hours about how to make the zoom level persistent throughout following links in various PDF's I have, and most sources were saying to just buy acrobat pro and edit the bookmarks manually with it.
    I saw that it was possible to write an application to change the property, and considered doing it after the only pre-existing custom application I could find was asking for $50.
    Thanks to you, I no longer have to worry about re-zooming every time I click a bookmark, and I'm not out $50 or the time it would take to code an app myself!
    From the bottom of my heart, thank you!

  • How do you set the Date & Time on Zen V Pl

    On the System menu I scroll down to Clock Settings. It gives me the options to view the?clock, put the?time in title, & the set the alarm. How do you?change the time & date?

    cwilliam4,
    Go to Extras -> Date and Time. Once you're inside, press and hold the Back button and you should have a list of additional options.
    Jason

  • How do you set the alert time to default to a set amount of time in the calendar?

    How do you set a default alert time in my calendar so I don't have to set it every time?

    Go iCal Preferences/General and click the default alert tick box at the bottom. You can then adjust the amount of minutes before the event for the alarm. NB. ticking the tickbox means you get an alarm for every entry.

Maybe you are looking for

  • How do i use my own dhcp server with airport extreme

    I just bought an airport extreme and I'm trying to replace my linksys router and another access point. I have my own dhcp/dns server and I want to continue using it. So far, I was not able to find the way to use NAT without DHCP (like I'm doing now w

  • How do I get Keychain Sign In to Stop Popping Up

    I have had nothing but problems with the latest security update and itunes update.   Now my keychain keeps on popping up telling me to enter a password every time something like the calendar needs to use the system.  Why does the keychain keep poppin

  • Fill transaction fields automatically through code

    Hi Gurus, Every time we create a material we have to extend it in all plants and in all storage location of every plant. The steps that we are using are: We first create the material to a plant and a storage location using transaction MM01. Then we u

  • XSD Messages in Mapping

    Hi All, I imported one XSD as External Definition, When i go under the Messages tab i see nearly 15 Messages. Now when i try to use this XSD is my Message mapping i get up a pop to select only one message out of available 15. Please let me know how c

  • I cant log in via CC DT app

    Put email and password in its a no go said email or password invalid. Changed password told me not to use previous password, so I wasn't going nuts after all Entered a new PW same thing tells me each time I've been logged out please sign in.  Is ther