today's date --version 1.1 by Mark Butcher, modified to give DD/MM/YY
triggered by CTRL D (EasyKeys)
tell application "Tex-Edit Plus"
activate
select window 1
end tell
copy day of (current date) to theDay
if theDay < 10 then copy "0" & theDay to theDay
repeat with theMonth from 1 to 12
if month of (current date) = item theMonth of ¬
{January, February, March, April, May, June, July, August, September, October, November, December} then exit repeat
end repeat
copy item theMonth of {"01", "02", "03", "04", "05", "06", "07", " 08", "09", "10", "11", "12"} to theMonth
copy (year of (current date)) mod 100 to theYear
if theYear < 10 then copy "0" & theYear to theYear
tell application "Tex-Edit Plus"
if not (front window exists) then -- end if no window
beep
else
copy theDay & "/" & theMonth & "/" & theYear as string to selection
end if
end tell
The shortcut key writes the date normally, but once only. Pressing ctrl D again brings the startup screen of the script with 2 buttons: Quit and Run. clicking on Run writes the date. But why am I getting this startup screen instead of executing the script? (in spite of having enabled the “never show startup screen” box)
Beige G3 Desktop 233 Mac OS 9.2.2