Onetastic
Home
Macroland
Blog
OneCalendar
Pricing
How To
Login
Download
Go to Macroland Home
Color PowerShell Comments
Changes color of text starting with a single quote (#) on selected lines to green
Download
Color PowerShell Comments
If this didn't work,
get help
downloading this macro
Author(s)
:
Synx
Category
:
Formatting
Last Updated
:
February 06, 2017
Requirements
:
OneNote 2010 or above
Changelog
:
February 06, 2017
(586342)
-
Synx
Initial Version
Comments
Name
E-mail me if someone replies
Comment
Send Feedback
Dan
- 2017-02-19
Thank you so Much!!
YOU ARE THE BEST OMER!!
Really Good Programmer.
I really needed to highlight all these words - as I am not very good with my eyesight and you did it for me.
I am sending you lots of good luck :)
Sorry for always hassling you with newbie code - I am trying to learn!
Thanks for making oneNote the Best
Because of you I changed from evernote to onenote!
And all the awesome macros you made
Have a great weekend!
Omer Atay
- 2017-02-18
Dan: I uploaded a new macro named "Highlight Hashtags"
Dan
- 2017-02-18
Hi Omer,
How can I just color the #word untill the first space.
Example only color #hello and not the whole paragraph.
I am trying to color some words similar to this.
<?xml version="1.0" encoding="utf-16"?>
<Macro name="Color PowerShell Comments" category="Test" description="" publishDate="00-00-00T00:00:00.000Z" version="15">
<Comment text="----------------------------------------------------------------------------------" />
<Comment text=" Color Powershell Comments" />
<Comment text="----------------------------------------------------------------------------------" />
<Expression>$color = "#358000"</Expression>
<Comment text="Find all the selected paragraphs" />
<ForEach var="p">
<Array>QueryObjects("Paragraph", GetCurrentPage())</Array>
<If>
<Condition>$p.selection == "none"</Condition>
<Continue>1</Continue>
</If>
<Comment text="Find hashes as the beginning of a comment" />
<Expression>$hashes = QueryText($p, "#", false)</Expression>
<If>
<Condition>Array_Length($hashes) == 0</Condition>
<Continue>1</Continue>
</If>
<Comment text="Start coloring from the first hash" />
<Expression>$hash = $hashes[0]</Expression>
<Expression>$hash.fontColor = $color</Expression>
<Comment text="Get all the text in the paragraph and color the ones that are after the first hash" />
<ForEach var="text">
<Array>QueryObjects("Text", $p)</Array>
<If>
<Condition>$text.startIndex > $hash.startIndex</Condition>
<Expression>$text.fontColor = $color</Expression>
</If>
</ForEach>
</ForEach>
</Macro>
I tried a lot of things but nothing works :(
thank you
Related Macros
All Section Font Arial Black, ...
Paragraph Spacing = 20
Indent First Line
Paragraph Spacing = 3
Paragraph Spacing = 9
OneNote转为MD格式
Paragraph Spacing = 0
Paragraph Spacing = 7
Add Space After Paragraphs
Remove All Indents From All Pa...
Clark_Title
Clark_Text
Clark_Code
字体修正
Format Numbers
Highlight Hashtags
Color PowerShell Comments + No...
Color VB Comments
Align and Space
Indent Paragraphs
中英样式
Select Text With Similar Forma...
设置默认格式
Toggle Red/Black
Align Left
See all other macros
Macros by This Author
Color PowerShell Comments + No...
Color PowerShell Comments
Show More