AppleScript名:stringFrom_makingIt のサンプル v2 |
— Created 2015-01-04 by Takaaki Naganoya — 2015 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" use bPlus : script "BridgePlus" –https://www.macosxautomation.com/applescript/apps/BridgePlus.html load framework set res0 to current application’s SMSForder’s |description|() as text –> "SMSForder” –Calculates the MD5 hash of a string set aStr to "0123456789" set a to bPlus’s MD5From:aStr –> "781e5e245d69b566979b86e28d23f2c7" –Converts straight quote marks into typographer’s quote marks set bStr to "’a’" set b to bPlus’s smartQuotedFrom:bStr –> "‘a’" –Converts typographer’s quote marks into straight quote marks set cStr to "‘a’" set c to bPlus’s unsmartQuotedFrom:cStr –> "’a’" –Encodes the five reserved XML characters only set d1Str to "&\"<>’" set d1 to bPlus’s encodedXMLFrom:d1Str –> "&"<>'" –Decode the five reserved XML characters only set d2Str to "&"<>'" set d2 to bPlus’s unencodedForXMLFrom:d2Str –> "&\"<>’" –Encodes characters outside ASCII 32-126 in hexadecimal form (&#xHHHH;) set eStr to "あいうえお" set e to bPlus’s encodedHexFrom:eStr –> "あいうえお" –Encodes characters outside ASCII 32-126 in decimal form (&#DD;), for use in HTML set fStr to "あいうえお" set f to bPlus’s encodedDecimalFrom:fStr –> "あいうえお" –Decodes characters that appear in decimal form (&#DD;) or hexidecimal form (&#xHHHH;), as used in XML and HTML set gStr to "あいうえお" set g to bPlus’s decodedDecimalFrom:gStr –> "あいうえお" –Deletes any paragraphs that are empty or contain only spaces and/or tabs set hStr to "a aaa a a " set h to bPlus’s emptyLineFreeFrom:hStr –> (* "a aaa a a a" *) –Converts runs of more than one space to a single space character, and trims spaces from the beginning and end of paragraphs. set hStr to " aaaaa bbbb ccccc " set h to bPlus’s cleanSpacedFrom:hStr –> "aaaaa bbbb ccccc" |
More from my site
(Visited 29 times, 1 visits today)