Re: Elementary file naming question
Re: Elementary file naming question
- Subject: Re: Elementary file naming question
- From: "Marc K. Myers" <email@hidden>
- Date: Tue, 16 Dec 2003 17:38:45 -0500
To: AppleScript <email@hidden>
From: Bernard Azancot <email@hidden>
Subject: Elementary fie naming question
Date: Tue, 16 Dec 2003 20:50:33 +0100
Hello scripters !
My problem is simple.
I would like to save a Tex Edit + file with a name containing the date.
I must have missed an AS book chapter... ;-)
=-=-
tell application "Tex-Edit Plus"
tell window 1
--replace blah blah...
--replace blah blah...
--replace blah blah...
set timestring to do shell script "date '+%d/%m/%Y'"
set TheNewName to "OCR " & timestring & " .txt"
--> File name example: "OCR. 16/12/03.txt"
save window 1 in file "IBM 01:Users:parents:Desktop:" & TheNewName &
" .txt" as string with creator +class TBB6;
end tell
end tell
Try replacing the slashes with dashes in the date format. The save
should not be in the tell to window 1. Also, you've got ".txt" in
there twice. This worked for me:
tell application "Tex-Edit Plus"
tell window 1
--replace blah blah...
--replace blah blah...
--replace blah blah...
set timestring to do shell script "date '+%d-%m-%Y'"
set TheNewName to "OCR " & timestring & ".txt"
--> File name example: "OCR. 16/12/03.txt"
end tell
save window 1 in file ("New Guy:Users:marc:Desktop:" & TheNewName)
with creator "TBB6"
end tell
--> OCR 16-12-2003.txt
Marc [12/16/03 5:34:05 PM]
_______________________________________________
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.