Menu

Skip to content
AppleScriptの穴
  • Home
  • Products
  • Books
  • Docs
  • Events
  • Forum
  • About This Blog
  • License
  • 仕事依頼

AppleScriptの穴

Useful & Practical AppleScript archive. Click '★Click Here to Open This Script' Link to download each AppleScript

love

Posted on 2月 6, 2018 by Takaaki Naganoya

Basicで作られた花文字プログラムを、AppleScriptに移植したものです。元は、ChipmunkBasic用のサンプルプログラムで、1996年作成のクレジットが銘打たれていますが、オリジナルはもっと昔に作られたものでしょう。

図形パターンは西新宿に置かれているロバート・インディアナ氏作のオブジェ「LOVE」(1965年発表)のデータそのものです。

下地に敷く文字は変更できますが、模様の文字列(LOVE)は固定データで持たせているので、そのままでは変更できません。

→ その後、英単語の花文字プログラムを作成してみました。

AppleScript名:love
— Created 2015-02-15 by Takaaki Naganoya
— 2015 Piyomaru Software

(*
20 rem PRINT "THANKS TO ROBERT INDIANA AND DAVID AHL"
21 rem print "contributed by ATStarr@Amherst.Edu 1996"
http://www.nicholson.com/rhn/basic/classic_programs/love.bas
*)

set charMode to "E" –J or E
set aTargChar to "makiko"
set outText to ""
set aSpc to returnSpc(charMode) of me

set aList to retLoveList()

set aPos to 0
set charFlag to true –false:space char

repeat with i in aList
  set j to contents of i
  
if charFlag = true then
    set aText to retCirculateStrs(aTargChar, j) of me
  else
    set aText to retCirculateStrs(aSpc, j) of me
  end if
  
  
set outText to outText & aText
  
  
set charFlag to not charFlag
  
  
set aPos to aPos + j
  
if aPos ≥ 60 then
    set aPos to 0
    
set outText to outText & return
    
set charFlag to true
  end if
end repeat

return outText

on retLoveList()
  return {60, 1, 12, 26, 9, 12, 3, 8, 24, 17, 8, 4, 6, 23, 21, 6, 4, 6, 22, 12, 5, 6, 5, 4, 6, 21, 11, 8, 6, 4, 4, 6, 21, 10, 10, 5, 4, 4, 6, 21, 9, 11, 5, 4, 4, 6, 21, 8, 11, 6, 4, 4, 6, 21, 7, 11, 7, 4, 4, 6, 21, 6, 11, 8, 4, 4, 6, 19, 1, 1, 5, 11, 9, 4, 4, 6, 19, 1, 1, 5, 10, 10, 4, 4, 6, 18, 2, 1, 6, 8, 11, 4, 4, 6, 17, 3, 1, 7, 5, 13, 4, 4, 6, 15, 5, 2, 23, 5, 1, 29, 5, 17, 8, 1, 29, 9, 9, 12, 1, 13, 5, 40, 1, 1, 13, 5, 40, 1, 4, 6, 13, 3, 10, 6, 12, 5, 1, 5, 6, 11, 3, 11, 6, 14, 3, 1, 5, 6, 11, 3, 11, 6, 15, 2, 1, 6, 6, 9, 3, 12, 6, 16, 1, 1, 6, 6, 9, 3, 12, 6, 7, 1, 10, 7, 6, 7, 3, 13, 6, 6, 2, 10, 7, 6, 7, 3, 13, 14, 10, 8, 6, 5, 3, 14, 6, 6, 2, 10, 8, 6, 5, 3, 14, 6, 7, 1, 10, 9, 6, 3, 3, 15, 6, 16, 1, 1, 9, 6, 3, 3, 15, 6, 15, 2, 1, 10, 6, 1, 3, 16, 6, 14, 3, 1, 10, 10, 16, 6, 12, 5, 1, 11, 8, 13, 27, 1, 11, 8, 13, 27, 1, 60}
end retLoveList

–Return Space (English Char/Japanese Char)
on returnSpc(aMode)
  if aMode = "E" then return " " –Single character Space
  
if aMode = "J" then return " " –Japanese Double Width Space
end returnSpc

on retCirculateStrs(aText, repCharTimes)
  set aLen to length of aText
  
set aTimes to repCharTimes div aLen
  
set aMod to repCharTimes mod aLen
  
set outStr to ""
  
  
repeat aTimes times
    set outStr to outStr & aText
  end repeat
  
  
if aMod is not equal to 0 then
    set aModStr to text 1 thru aMod of aText
    
set outStr to outStr & aModStr
  end if
  
  
return outStr
end retCirculateStrs

★Click Here to Open This Script 

(Visited 22 times, 1 visits today)

More from my site

  • Wikipedia経由で2つの単語の共通要素を計算するcommon elements Lib Script LibraryWikipedia経由で2つの単語の共通要素を計算するcommon elements Lib Script Library
  • 画面上の指定座標にマウスカーソルを強制移動させてクリック画面上の指定座標にマウスカーソルを強制移動させてクリック
  • checkboxLibをアップデート(3)sdefにサンプルドキュメントを入れるcheckboxLibをアップデート(3)sdefにサンプルドキュメントを入れる
  • checkboxLibをアップデートcheckboxLibをアップデート
  • アイテム番号リストをもとに、ヒットしなかった項目を返すアイテム番号リストをもとに、ヒットしなかった項目を返す
  • メインScript側で宣言したglobal変数値をサブ側で使用するメインScript側で宣言したglobal変数値をサブ側で使用する
Posted in Text | Tagged 10.11savvy 10.12savvy 10.13savvy | 2 Comments

2 thoughts on “<span>love</span>”

  1. 12/11/18
    2:19 PM
    2018年12月11日
    2:19 PM

    Reply

    指定文字の花文字テキストを取得する(Retina対応) – AppleScriptの穴 says:

    […] 類似の処理にこのようなものがあります。 → Love […]

  2. 3/29/19
    11:45 PM
    2019年3月29日
    11:45 PM

    Reply

    指定単語の花文字テキストを取得する(Retina対応)英文字用 v2 – AppleScriptの穴 says:

    […] この、花文字テキストを出力するプログラムの英語版としては、love.scptといういにしえのデータをそのまま使いまわしたものがありますが、描画パターンを数値データで保持しているた […]

Leave a Reply to 指定単語の花文字テキストを取得する(Retina対応)英文字用 v2 – AppleScriptの穴 Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

電子書籍(PDF)をオンラインストアで販売中!

Google Search

Popular posts

  • ebook:アーケードゲーム「戦場の絆」僕らの15年戦争
  • macOS 12が正式リリースされる
  • macOS 12 beta5でAppleScript処理系の大幅なスピードアップ。M1もIntelも
  • AppleScriptからショートカット実行&ショートカット内でAppleScriptを実行
  • Xcode 13.2 〜 13.3は有害(正式版でもまだ有害)
  • M1 Macの各種温度センサーから値を取得する
  • Intel MacとApple Silicon Macの速度差〜画像処理
  • AS Publisher v18
  • 2021年に書いた価値あるAppleScript
  • 新刊 elgato STREAM DECK 徹底活用Mac+STREAM DECKで時短+作業効率化!! 刊行
  • macOS 11.5+Keynote 11.1でGUI Scriptingに障害?
  • CotEditorで選択範囲の行頭にある数字をリナンバーする v1
  • Stream Deck Softwareがバージョン5.1.2にバージョンアップ
  • 「AppleScript最新リファレンス」に追加ダウンロードコンテンツ
  • AppleScriptによるWebブラウザ自動操縦ガイド
  • Shortcuts Eventsでショートカットのインストール+実行
  • マウスの右クリックメニューをカスタマイズするService Station
  • Amazon EC2 M1 Macインスタンスが利用可能に
  • macOS 12.x上のAppleScriptのトラブルまとめ
  • macOS 12.3 beta 5、ASの障害が解消される(?)

Tags

10.11savvy (1102) 10.12savvy (1243) 10.13savvy (1389) 10.14savvy (565) 10.15savvy (400) 11.0savvy (235) 12.0savvy (106) CotEditor (54) Finder (46) iTunes (19) Keynote (83) NSAlert (60) NSArray (51) NSBezierPath (18) NSBitmapImageRep (21) NSBundle (20) NSButton (34) NSColor (51) NSDictionary (27) NSFileManager (23) NSFont (18) NSImage (42) NSJSONSerialization (21) NSMutableArray (61) NSMutableDictionary (21) NSPredicate (36) NSRunningApplication (56) NSScreen (30) NSScrollView (22) NSString (117) NSURL (97) NSURLRequest (23) NSUTF8StringEncoding (30) NSUUID (18) NSView (33) NSWindow (17) NSWorkspace (20) Numbers (51) Pages (32) Safari (38) WKUserContentController (21) WKUserScript (20) WKUserScriptInjectionTimeAtDocumentEnd (18) WKWebView (22) WKWebViewConfiguration (22)

カテゴリー

  • 2D Bin Packing
  • AirDrop
  • AirPlay
  • Animation
  • AppleScript Application on Xcode
  • Bluetooth
  • Books
  • boolean
  • bounds
  • Bug
  • Calendar
  • call by reference
  • Clipboard
  • Code Sign
  • Color
  • Custom Class
  • dialog
  • drive
  • exif
  • file
  • File path
  • filter
  • folder
  • Font
  • Font
  • GAME
  • geolocation
  • GUI
  • GUI Scripting
  • History
  • How To
  • Icon
  • Image
  • Input Method
  • Internet
  • iOS App
  • JavaScript
  • JSON
  • JXA
  • Keychain
  • Language
  • list
  • Locale
  • Machine Learning
  • Markdown
  • Menu
  • Metadata
  • MIDI
  • MIME
  • Natural Language Processing
  • Network
  • news
  • Noification
  • Notarization
  • Number
  • Object control
  • OCR
  • OSA
  • PDF
  • Peripheral
  • PRODUCTS
  • QR Code
  • Raw AppleEvent Code
  • Record
  • recursive call
  • regexp
  • Release
  • Remote Control
  • Require Control-Command-R to run
  • REST API
  • Review
  • RTF
  • Sandbox
  • Screen Saver
  • Script Libraries
  • sdef
  • search
  • Security
  • selection
  • shell script
  • Shortcuts Workflow
  • Sort
  • Sound
  • Spellchecker
  • Spotlight
  • SVG
  • System
  • Tag
  • Telephony
  • Text
  • Text to Speech
  • timezone
  • Tools
  • Update
  • URL
  • UTI
  • Web Contents Control
  • WiFi
  • XML
  • XML-RPC
  • イベント(Event)
  • 未分類

アーカイブ

  • 2022年5月
  • 2022年4月
  • 2022年3月
  • 2022年2月
  • 2022年1月
  • 2021年12月
  • 2021年11月
  • 2021年10月
  • 2021年9月
  • 2021年8月
  • 2021年7月
  • 2021年6月
  • 2021年5月
  • 2021年4月
  • 2021年3月
  • 2021年2月
  • 2021年1月
  • 2020年12月
  • 2020年11月
  • 2020年10月
  • 2020年9月
  • 2020年8月
  • 2020年7月
  • 2020年6月
  • 2020年5月
  • 2020年4月
  • 2020年3月
  • 2020年2月
  • 2020年1月
  • 2019年12月
  • 2019年11月
  • 2019年10月
  • 2019年9月
  • 2019年8月
  • 2019年7月
  • 2019年6月
  • 2019年5月
  • 2019年4月
  • 2019年3月
  • 2019年2月
  • 2019年1月
  • 2018年12月
  • 2018年11月
  • 2018年10月
  • 2018年9月
  • 2018年8月
  • 2018年7月
  • 2018年6月
  • 2018年5月
  • 2018年4月
  • 2018年3月
  • 2018年2月

https://piyomarusoft.booth.pm/items/301502

メタ情報

  • 登録
  • ログイン
  • 投稿フィード
  • コメントフィード
  • WordPress.org

Forum Posts

  • 人気のトピック
  • 返信がないトピック

メタ情報

  • 登録
  • ログイン
  • 投稿フィード
  • コメントフィード
  • WordPress.org
Proudly powered by WordPress
Theme: Flint by Star Verte LLC