Current Date

Have a problem? A question? This is the place for answers from other Express users.
Post Reply
beetone
Posts: 21
Joined: 2005-03-23 15:38:15
Location: Kingston, Canada

Current Date

Post by beetone »

Does NWE have the capability of automatically inserting the current date? A couple of other word processors that I have used can do this but I can’t find this option in Nisus Writer. I have found it useful and I suspect that I am just missing something in the menu.
cgc
Posts: 80
Joined: 2004-09-19 13:30:46
Location: California
Contact:

Post by cgc »

WordServies (http://www.devon-technologies.com/produ ... eeware.php) is free and adds this capability to the Services menu.
cchapin
Posts: 424
Joined: 2004-02-25 18:28:40
Location: Nagoya, Japan

Post by cchapin »

Nisus Writer Express comes with a macro for inserting a date. Look in the Macro menu for "Date Stamp." If you don't like the format that this macro produces, you might like one of the Perl scripts or AppleScripts that a few NWE users have written. I believe Nisus was going to start a downloadable scripts repository, but I haven't heard anything about that of late.

Hatchmo posted one script here. Here's a different Perl script that I wrote. Bear in mind that I'm a novice at this.

Code: Select all

#Nisus Macro Block
#destination clipboard
#source none
#Before Execution
#Clipboard 1
#After Execution
#Paste
#Clipboard 0
#End Nisus Macro Block
use strict;

# This macro gets the system date, formats it, then inserts it at the
# insertion point in the current Nisus Writer Express document.
# It is intended for English use, but could be adapted for other languages
# and time formats.
# --Craig Chapin (September 5, 2004)

#Declaration of variables.  Comment out (#) those you don't need.

#my $DayWeek;
my $Month;
my $DayMonth;
my $Year;
#my $Hour;
#my $Minute;
#my $AmPm;
#my $Second;

# The following block is used farther down to convert month abbreviations
# to full names.

my %MonthName = (
	"Jan" => "uary",
	"Feb" => "ruary",
	"Mar" => "ch",
	"Apr" => "il",
	"May" => "",
	"Jun" => "e",
	"Jul" => "y",
	"Aug" => "ust",
	"Sep" => "tember",
	"Oct" => "ober",
	"Nov" => "ember",
	"Dec" => "ember"
);

# The following block may be used to convert day-of-week abbreviations to
# full names. Comment it out or uncomment it to suit your needs. Also
# comment out or uncomment the appropriate lines farther down.

#my %DayName = (
#	"Sun" => "day",
#	"Mon" => "day",
#	"Tue" => "sday",
#	"Wed" => "nesday",
#	"Thu" => "rsday",
#	"Fri" => "day",
#	"Sat" => "urday"
#);

# The following block gets the system time and formats some of its elements.
# Comment out (#) the elements that you don't need.
# Don't comment the first line out. It gets the system time and isolates
# its elements.
# A typical system time string looks like this: Mon Jan  31 13:30:00 2000

if (localtime(time()) =~ /(\w+)\s+(\w+)\s+(\d+)\s+(\d+):(\d+):(\d+)\s+(\d+)/) {
#	$DayWeek .= $1 . $DayName{$1};	#Captures and expands day-of-week abbr.
	$Month .= $2 . $MonthName{$2};	#Captures and expands month abbr.
	$DayMonth = $3;	#Captures day of month, just for ease of use
	$Year = $7;	#Captures year, just for ease of use
#	$Minute = $5;	#Captures minutes, just for ease of use
#	$Second = $6;	#Captures seconds, just for ease of use
#	if ($4 >= 12) {	#This block converts hour to a 12-hour clock.
#		$Hour = $4 - 12;
#		$AmPm = "p.m.";
#	} elsif ($4 = 0) {
#		$Hour = $4 + 12;
#		$AmPm = "a.m.";
#	} else {
#		$Hour = $4;
#		$AmPm = "a.m.";
#	}
}

# The following lines format and insert the time.
# Choose the format you want and comment out the others.

#print "$DayWeek, $Month $DayMonth, $Year ($Hour:$Minute $AmPm)";
	# Example: Monday, January 31, 2000 (1:30 p.m.)
#print "$DayWeek, $Month $DayMonth, $Year";
	# Example: Monday, January 31, 2000
print "$Month $DayMonth, $Year";
	# Example: January 31, 2000
#print "$DayMonth $Month $Year";
	# Example: 31 January 2000
#print "$Hour:$Minute $AmPm";
	# Example: 1:30 p.m.
#print "$4:$Minute:$Second";
	# Example: 13:30:00
Feel free to comment in or out whatever gives you the format you want. The Nisus Writer Express documentation contains general instructions for creating Nisus macros with Perl. If you'd rather have me send this to you as a file, send me a private message.

And, official Nisus people, did anything come of that macro repository idea?

--Craig
beetone
Posts: 21
Joined: 2005-03-23 15:38:15
Location: Kingston, Canada

Date Stamp

Post by beetone »

Thanks for the info re the date stamp in the Macro menu.
However, what I was referring to was the capability of automatically updating a date on a document whenever it is opened and modified.
I could do this in AppleWorks and Mellel and was surprised that NWE doesn’t appear to have this ability.
cchapin
Posts: 424
Joined: 2004-02-25 18:28:40
Location: Nagoya, Japan

Post by cchapin »

You're right. Nisus Writer Express doesn't currently have that ability. Excuse my misunderstanding. I have never used automatically updating dates much in other applications, but apparently others do. It might be on the list of features to add in the future, but I don't really know.

--Craig
charles
Posts: 481
Joined: 2002-11-26 11:40:35
Location: San Diego, CA
Contact:

Post by charles »

Hi:

This date feature is certainly on our list. I don't think it will get finished in time for this next release, but it should be ready soon after.

We have not forgotten about the macro repository idea either. We are going to focus on Macros in general soon and this is when we will look into setting up something more serious.

-Charles
Charles Jolley
Nisus Software, Inc.
midwinter
Posts: 333
Joined: 2004-09-09 18:07:11
Location: Utah
Contact:

Post by midwinter »

charles wrote:Hi:

This date feature is certainly on our list. I don't think it will get finished in time for this next release, but it should be ready soon after.

We have not forgotten about the macro repository idea either. We are going to focus on Macros in general soon and this is when we will look into setting up something more serious.

-Charles
Charles: Why not just use a wiki?
Chris Squire
Posts: 1
Joined: 2005-11-09 12:47:05
Location: Twickenham, UK

Post by Chris Squire »

I would like to reinforce the requests for an 'insert date & time' facility. I have just upgraded, with great reluctance, from MS Word for Mac 5.1 (1992) , which provides this, which I use all the time to date everything I print out from WP. So I was somewhat (British understatement) surprised and disgruntled to discover that I can't do this no more, tho' I will investigate the options offered above, for which I thank you.

That apart, I am pleased with Nisus Writer.
Post Reply