Created
August 23, 2012 02:37
-
-
Save sugimotoak/3431577 to your computer and use it in GitHub Desktop.
_人人人人人人_ > 突然の死 <  ̄Y^Y^Y^Y^Y ̄ を作ってくれるAppleScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
property hankakuText : " 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-+*/=(){}[].,~!?@\"\\#$%&¥|'^;:<>_アイウエオカキクケコサシスセソタチツテトナニヌネノハヒムヘホマミムメモヤユヨワヲンァィゥェォャュョー`。、・「」" | |
display dialog "突然の死ジェネレータ" default answer "突然の死" | |
set str to text returned of result | |
set textSize to getTextSize(str) | |
set the clipboard to text of getUpText(textSize) & getMidText(str) & getBoText(textSize) | |
on getBoText(theTextSize) | |
set centerText to "" | |
set cnt to theTextSize div 2.0 | |
repeat cnt times | |
set centerText to centerText & "Y^" | |
end repeat | |
return " ̄Y^" & centerText & "Y ̄" | |
end getBoText | |
on getMidText(theText) | |
return "> " & theText & " <" & return | |
end getMidText | |
on getUpText(theTextSize) | |
set centerText to "" | |
set cnt to theTextSize div 2 | |
repeat cnt times | |
set centerText to centerText & "人" | |
end repeat | |
return "_人" & centerText & "人_" & return | |
end getUpText | |
on getTextSize(theText) | |
set textSize to 0 | |
considering case | |
repeat with charItem in theText | |
if hankakuText contains charItem then | |
set textSize to textSize + 1 | |
else | |
set textSize to textSize + 2 | |
end if | |
end repeat | |
end considering | |
return textSize | |
end getTextSize |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment