Jump to content
Macro Express Forums

change font color


ayelet
 Share

Recommended Posts

I want to create a macro that will find text of a specific font color (in topics in RoboHelp) and then replace it with a different color. I thought I would have it open each topic, copy all content to clipboard, and bit by bit Get Pixel, and when the Get Pixel returned a certain value, apply a certain font color (from Format>Font). I can't even manage though to Get Pixel to return a value (just so I can check what the pixel value is that I'm looking for) Is there any reason that Type Text of the Get Pixel variable shouldn't work?

Thanks.

Link to comment
Share on other sites

There are a couple of ways to get the font color using the Get Pixel Color command. Both options require you to save the value to an integer value. To do so, select the variable that you wish to save it to at the bottom of the Get Pixel Color command. To view the value for testing purposes, you could insert a Text Box Display command with %N1% in it. This will allow you to view the color to insure that it is working properly. You would then need to insert an If Variable Equals command to determine if it meets your criteria or not. From here, you can tell it what you want to do if it does, or does not, equal the color you are searching for.

 

The two options in obtaining the pixel color are Underneath Mouse, or At Specific Coordinates. The Underneath Mouse option would require you to use the Mouse Move command to place the mouse in the correct position before capturing the color. The Specific Coordinate option requires you to know the exact coordinates. If you are unsure of the coordinates, you can use the Mouse Locator by pressing the Launch Mouse Locator button on the Get Pixel Color window.

Link to comment
Share on other sites

. . . The Specific Coordinate option requires you to know the exact coordinates. . . .

 

It's too bad you can't click on the first word, then use <Ctrl><Right Arrow><Ctrl><Right Arrow><Ctrl><Right Arrow>to progress word-by-word, checking pixel color along the way, but I don't think this is possible in help files....

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...