AppleScript名:伏字文字列を作成する v4 |
— Created 2015-09-09 by Shane Stanley use AppleScript version "2.4" use scripting additions use framework "Foundation" set aStr to "これは秘密のInformationです。" –Alphabet & Numeric以外でも置換可能 set bStr to makeUnprintableChars(aStr) –> "xxxxxxXxxxxxxxxxxxx。" on makeUnprintableChars(aStr) set anNSString to current application’s NSString’s stringWithString:aStr set anNSString to anNSString’s stringByReplacingOccurrencesOfString:"[\\p{Lu}\\p{Lt}\\p{Nd}]" withString:"X" options:(current application’s NSRegularExpressionSearch) range:{0, anNSString’s |length|()} set anNSString to anNSString’s stringByReplacingOccurrencesOfString:"[\\p{Ll}\\p{Lm}\\p{Lo}]" withString:"x" options:(current application’s NSRegularExpressionSearch) range:{0, anNSString’s |length|()} return anNSString as text end makeUnprintableChars |
More from my site
(Visited 26 times, 1 visits today)