Skip to content

Instantly share code, notes, and snippets.

@sugimotoak
Created August 23, 2012 02:37
Show Gist options
  • Save sugimotoak/3431577 to your computer and use it in GitHub Desktop.
Save sugimotoak/3431577 to your computer and use it in GitHub Desktop.
_人人人人人人_ > 突然の死 <  ̄Y^Y^Y^Y^Y ̄ を作ってくれるAppleScript
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