Re: numeric date
Re: numeric date
- Subject: Re: numeric date
- From: Doug McNutt <email@hidden>
- Date: Sat, 19 Jul 2003 09:12:25 -0600
At 11:08 +0200 7/19/03, email@hidden wrote (and I snipped):
>
I need to convert the month from the current date to a 2-digit number.
>
The script below does the job, but does anybody have a better solution?
Here's a shell script I use for that kind of thing. The first lines are all you care about and you would have to "do shell script" in OX neXt to get to it. I use it to pass blocks of selected text to and from my OS neXt box and my good old 8500 running 9.1 with MPW. There's a companion MPW script that goes the other way.
I strongly recommend that you drop the dots in your date codes. They can confuse other operating systems. You're right in the order. Sorts by file names come out right.
#!/bin/tcsh
set clipcode = clip_`date +%y%m%d%H%M%S`.txt
set textfile = /Volumes/Mimas/Transfer/$clipcode
set tmpfile = /tmp/$clipcode
pbpaste > $tmpfile
cp $tmpfile $textfile
rm $tmpfile
SetFile -t TEXT -c 'MPS ' $textfile
--
--> There are 10 kinds of people: those who understand binary, and those who don't <--
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.