Last Friday of each month: Difference between revisions

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(2012intFrom, 2016intTo)))))
end run
Line 229 ⟶ 257:
{{Out}}
 
<pre>20122014-01-2731 20132015-01-2530 20142016-01-3129 20152017-01-3027 20162018-01-2926
20122014-02-2428 20132015-02-2227 20142016-02-2826 20152017-02-2724 20162018-02-2623
20122014-03-3028 20132015-03-2927 20142016-03-2825 20152017-03-2731 20162018-03-2530
20122014-04-2725 20132015-04-2624 20142016-04-2529 20152017-04-2428 20162018-04-2927
20122014-05-2530 20132015-05-3129 20142016-05-3027 20152017-05-2926 20162018-05-2725
20122014-06-2927 20132015-06-2826 20142016-06-2724 20152017-06-2630 20162018-06-2429
20122014-07-2725 20132015-07-2631 20142016-07-2529 20152017-07-3128 20162018-07-2927
20122014-08-3129 20132015-08-3028 20142016-08-2926 20152017-08-2825 20162018-08-2631
20122014-09-2826 20132015-09-2725 20142016-09-2630 20152017-09-2529 20162018-09-3028
20122014-10-2631 20132015-10-2530 20142016-10-3128 20152017-10-3027 20162018-10-2826
20122014-11-3028 20132015-11-2927 20142016-11-2825 20152017-11-2724 20162018-11-2530
20122014-12-2826 20132015-12-2725 20142016-12-2630 20152017-12-2529 20162018-12-3028</pre>
 
=={{header|AutoHotkey}}==
9,658

edits