Last Friday of each month: Difference between revisions
→AppleScript
Line 86:
<lang AppleScript>on run argv
-- Default range in absence of arguments: from two years ago, to two years ahead
-- Up to two optional command line arguments: [yearFrom], [yearTo]
-- ~ $ osascript ~/Desktop/lastFridays.scpt
--
-- ~ $ osascript ~/Desktop/lastFridays.scpt 2013
--
-- ~ $ osascript ~/Desktop/lastFridays.scpt 2013 2016
set intThisYear to year of (current date)
if class of argv is list then
set lngArgs to length of argv
if lngArgs > 0 then
if lngArgs > 1 then
set {intFrom, intTo} to argv
else
set intYear to item 1 of argv
set {intFrom, intTo} to {intYear, intYear}
end if
else
set {intFrom, intTo} to {intThisYear - 2, intThisYear + 2}
end if
else
set {intFrom, intTo} to {intThisYear - 2, intThisYear + 2}
end if
intercalate(linefeed, ¬
map(isoRow, ¬
transpose(map(lastFridaysOfYear, range(
end run
Line 229 ⟶ 257:
{{Out}}
<pre>
=={{header|AutoHotkey}}==
|