WaterMark with Roman Date ver 2.5

I have been Playing around with this for awhile.. Work very well for me...


AppleScript: @ccstone :smile:

--By Christopher Stone (AKA ccstone)
try
	tell (current date)
	set yearInt to its year
	set monthInt to its month as integer
	set dayInt to its day
end tell

	set defaultDateString to (dayInt & "/" & monthInt & "/" & yearInt) as text

tell current application
	set userDateString to text returned of (display dialog "Enter a date of the form: DD/MM/YYYY" with title "AppleScript By Christopher Stone (AKA ccstone)" default answer defaultDateString as text)
end tell
	
	if userDateString ≠ defaultDateString then
		set AppleScript's text item delimiters to "/"
		set {dayInt, monthInt, yearInt} to text items of userDateString
	end if
	
on error e number n
	set e to e & return & return & "Num: " & n
	if n ≠ -128 then
		try
			tell current application to button returned of ¬
				(display dialog e with title "ERROR!" buttons {"Copy Error Message", "Cancel", "OK"} ¬
					default button "OK" giving up after 30)
			if ddButton = "Copy" then set the clipboard to e
		end try
	end if
end try


try
	
	set RomanYear to ""
	repeat with i from 1 to (count (yearInt as string))
		set RomanYear to item (((item -i of (yearInt as string)) as integer) + 1) of item i of ¬
			{{"", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX"}, ¬
				{"", "X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC"}, ¬
				{"", "C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM"}, ¬
				{"", "M", "MM", "MMM"}} & RomanYear
	end repeat
	set RomanMonth to item monthInt of {"I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", "XII", "XII"}
	set RomanDay to item dayInt of {"I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII", "XIII", "XIV", "XV", "XVI", "XVII", "XVIII", "XIX", "XX", "XXI", "XXII", "XXXII", "XXIV", "XXV", "XXVI", "XXVII", "XXVIII", "XXIX", "XXX", "XXXI"}
	set the clipboard to RomanDay & "-" & RomanMonth & "-" & RomanYear
	
	--display notification RomanDay & "-" & RomanMonth & "-" & RomanYear with title "Roman Numerles set to Clipboard" sound name "Submarine"
	
on error e number n
	set e to e & return & return & "Num: " & n
	if n ≠ -128 then
		try
			tell current application to button returned of ¬
				(display dialog e with title "ERROR!" buttons {"Copy Error Message", "Cancel", "OK"} ¬
					default button "OK" giving up after 30)
			if ddButton = "Copy" then set the clipboard to e
		end try
	end if
end try

Download Macro: WaterMark with Roman Date ver 2.5.kmmacros (10.6 KB)

Once Again I like to Thank everyone for their help.
BTW I'm no programer of any sort just expert on just nothing.. :smile:

2 Likes