I’m trying to add a ‘###’ to the results of this code:
on execute()
set theCurrentDate to (current date)
set theWeekday to weekday of theCurrentDate
if theWeekday = Monday then
set startingDate to theCurrentDate
else if theWeekday = Tuesday then
set startingDate to theCurrentDate - 1 * days
else if theWeekday = Wednesday then
set startingDate to theCurrentDate - 2 * days
else if theWeekday = Thursday then
set startingDate to theCurrentDate - 3 * days
else if theWeekday = Friday then
set startingDate to theCurrentDate - 4 * days
else if theWeekday = Saturday then
set startingDate to theCurrentDate - 5 * days
else if theWeekday = Sunday then
set startingDate to theCurrentDate - 6 * days
else
error number -128
end if
set dateList to {date string of startingDate}
repeat with i from 1 to 4
set theDate to startingDate + i * days
set end of dateList to date string of theDate
end repeat
dateList --> {"Monday, September 6, 2021", "Tuesday, September 7, 2021", "Wednesday, September 8, 2021", "Thursday, September 9, 2021", "Friday, September 10, 2021"}
set {TID, text item delimiters} to {text item delimiters, linefeed}
set dateList to dateList as text
set text item delimiters to TID
return dateList -- a string of paragraphs of the dates
end execute
The result would be this:
Monday, September 20, 2021
Tuesday, September 21, 2021
Wednesday, September 22, 2021
Thursday, September 23, 2021
Friday, September 24, 2021
How can I add two hashtags to the left of each weekday? Like so but within the code above:
Monday, September 20, 2021
Tuesday, September 21, 2021
Wednesday, September 22, 2021
Thursday, September 23, 2021
Friday, September 24, 2021
Model: 2009 iMac
AppleScript: 2.7
Browser: Safari 537.36
Operating System: macOS 10.13