AppleScript名:テキストによるプログレスインジケータ作成 v2 |
set aList to {50, 24} –max-num, cur-num set cList to {".", "o"} set aRes to retProgressChar(aList, cList) of me –> "ooooo….." on retProgressChar(aList, cList) set barCharLen to 10 set allNum to item 1 of aList set doneNum to item 2 of aList if doneNum > allNum then return "" set oneStep to 100 / allNum set curStep to doneNum * oneStep set stringBar to (curStep / barCharLen) set stringBar2 to round stringBar rounding as taught in school –未処理アイテム数 set notYet to barCharLen – stringBar2 set notYetChar to contents of item 1 of cList set doneChar to contents of item 2 of cList set notYetText to makeCharRep(notYet, notYetChar) of me set doneText to makeCharRep(stringBar2, doneChar) of me set aText to doneText & notYetText return aText end retProgressChar –指定文字を指定回数連結したテキストを返す on makeCharRep(aNum, aChar) set aText to "" repeat aNum times set aText to aText & aChar end repeat return aText end makeCharRep |
More from my site
(Visited 81 times, 1 visits today)