Onetastic
Home
Macroland
Blog
OneCalendar
Pricing
How To
Login
Download
Go to Macroland Home
Append Date to Title (dd.mm.yy)
Modifies the page title to append the date in DD.MM.YY format
Download
Append Date to Title (dd.mm.yy)
If this didn't work,
get help
downloading this macro
Author(s)
:
jkhanhl
Category
:
Title
Last Updated
:
June 05, 2017
Requirements
:
OneNote 2010 or above
Changelog
:
June 05, 2017
(3CEC7E)
-
jkhanhl
Initial Version
Comments
Name
E-mail me if someone replies
Comment
Send Feedback
Omer Atay
- 2017-07-27
DMills: This macro has an example of going through each page in the current section: https://getonetastic.com/macroland&id=D691976E51554F2CAD2D155F9CE4C992
DMills
- 2017-07-26
Omer Atay:
I apologize. I'm actually a newbie when it comes to coding. However, in some cases I'm able to pick up how things work by looking at code. Can you assist me with what you're describing? Here is the XML that I have so far:
<?xml version="1.0" encoding="utf-16"?>
<Macro name="Append Date to Title (dd.mm.yy)" category="Title" description="Modifies the page title to append the date in DD.MM.YY format" version="18">
<Expression>$Page = GetCurrentPage()</Expression>
<Expression>$Date = QueryObjects("Page", $Page)[0].dateTime</Expression>
<Expression>$Title = QueryObjects("Paragraph", $Page)[0].text</Expression>
<Expression>$ShortYear = DateTime_Year($Date)</Expression>
<Expression>$ShortYear = ($ShortYear -= 2000)</Expression>
<Expression>QueryObjects("Paragraph", $Page)[0].text = ((((($ShortYear & ".") & (DateTime_Month($Date) & ".")) & DateTime_Day($Date)) & " - ") & $Title)</Expression>
</Macro>
Omer Atay
- 2017-07-26
DMills: You can do something like: ForEach $page in GetCurrentSection().pages, and then do everything under that for loop using $page instead of GetCurrentPage().
Show more comments
(1 more)
DMills
- 2017-07-25
I have tweaked the Append Date to Title (dd.mm.yy) macro so it now adds the created date (yy.mm.dd) in front of the selected page title (ex. 17.07.25 - Current Page Title). This makes it easier to sort the pages in a given section by the created date.
I would like to take it a step further and be able to apply this to all pages in the currently selected section with one click instead of having manually select and apply to each page. Any help?
Related Macros
Set Page Titles
Changes title of each page in ...
Add/Remove Date/Time from Titl...
Add Date before Title (YYYY_MM...
Prepends Create Date *yyyy.mm....
Sum Hours in Page Titles of Cu...
*Prepend Page Date to Title (C...
Add Date before Title (yy/mm/d...
Prepends Create Date *yyyymmdd...
Append Date to Title (dd.mm.yy...
Append Date to Title (dd.mm.yy...
Append Date to Title (dd.mm.yy...
Add *yymmdd* as Note title pre...
Add *yymmdd* as Note title pre...
Prepend Creation to Title (yym...
Append Desired Text to All Pag...
Task Count + Tags
Task Count++
Add Author to Title
Insert Page At Top With YYYY-M...
Insert Page At Bottom With Tit...
Crear tÃtulo fecha
Create a title for the page
Customize the Title
See all other macros
Macros by This Author
Append Date to Title (dd.mm.yy...
Show More