Title + Date
title and date

Script key: title and date

Posted by Nikito

Install

Details

Label Title + Date
Voice Over title and date
Script
// Modified from 'Insert today's date
// EU' in the Agile Tortoise directory

var now = new Date();
var dd = now.getDate();
var mm = now.getMonth()+1;
var yyyy = now.getFullYear();
var hour = now.getHours();
var minute = now.getMinutes();
var ampm = 'AM';

if(dd < 10) {
    dd = '0' + dd;
} 

if(mm < 10) {
    mm = '0' + mm;
}

if(hour > 12) {
    hour -= 12;
    ampm = 'PM';
}

if(hour === 0) {
    hour = 12;
    ampm = 'AM';
}

if(minute < 10) {
    minute = '0' + minute;
}

var titletoday = '## \n\n'+yyyy+'-'+mm+'-'+dd+' '+hour+':'+minute+' '+ampm+'\n\n';
var selRange = getSelectedRange();
setSelectedText(titletoday);
setSelectedRange(selRange[0]+26,0);

Advanced

Keyboard shortcut None
Hide key Yes

Discussion

comments powered by Disqus