<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>オートクック！</title>
	<atom:link href="https://automa-recipe.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://automa-recipe.com</link>
	<description>iPhoneショートカットまとめサイト</description>
	<lastBuildDate>Mon, 11 Apr 2022 09:21:14 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://automa-recipe.com/wp-content/uploads/2022/02/cropped-オートクック！-300-x-80-px-300-x-300-px-2-32x32.png</url>
	<title>オートクック！</title>
	<link>https://automa-recipe.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>実践！iPhoneショートカットでWeb APIを使いこなそう！</title>
		<link>https://automa-recipe.com/learn-programming/shortcuts-webapi-practice/</link>
					<comments>https://automa-recipe.com/learn-programming/shortcuts-webapi-practice/#respond</comments>
		
		<dc:creator><![CDATA[automa-recipe]]></dc:creator>
		<pubDate>Sat, 19 Feb 2022 07:38:09 +0000</pubDate>
				<category><![CDATA[プログラミング教室]]></category>
		<category><![CDATA[まとめ]]></category>
		<guid isPermaLink="false">https://automa-recipe.com/?p=3873</guid>

					<description><![CDATA[<p><img src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー.png" class="webfeedsFeaturedVisual" /></p><p>ついに、Web APIを使ってショートカットを作る実践編に突入しました。 前回の記事では、「知識編」として Web APIとは何か ショートカットでWeb APIを使う方法の概要 について解説しました。 まだ見ていない方 [&#8230;]</p>
<p>The post <a href="https://automa-recipe.com/learn-programming/shortcuts-webapi-practice/">実践！iPhoneショートカットでWeb APIを使いこなそう！</a> first appeared on <a href="https://automa-recipe.com">オートクック！</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><img src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー.png" class="webfeedsFeaturedVisual" /></p><p>ついに、<span class="swl-marker mark_yellow">Web APIを使ってショートカットを作る実践編に突入しました。</span></p>



<p><a href="https://automa-recipe.com/learn-programming/webapi-dict/" title="Web APIって何？iPhoneショートカットで活用する方法！">前回の記事</a>では、「知識編」として</p>



<ul class="is-style-check_list wp-block-list"><li>Web APIとは何か</li><li>ショートカットでWeb APIを使う方法の概要</li></ul>



<p>について解説しました。</p>



<p>まだ見ていない方は先にこちらの記事をご覧ください！</p>


<div class="swell-block-postLink" data-style="card">			<a href="https://automa-recipe.com/learn-programming/webapi-dict/" class="p-blogCard -internal" data-type="type3">
			<div class="p-blogCard__inner">
				<span class="p-blogCard__caption">あわせて読みたい</span>
				<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー-300x169.png" alt="" class="c-postThumb__img -no-lb"></figure></div>				<div class="p-blogCard__body">
					<span class="p-blogCard__title">Web APIって何？iPhoneショートカットで活用する方法！</span>
					<span class="p-blogCard__excerpt">みなさん、「Web API」って知っていますか？ 全く知らない、聞いたことがあるけど使ったことがない、という人が多いのではないでしょうか？ Web APIを使いこなすことが&#8230;</span>				</div>
			</div></a>
		</div>


<p>今回は、<strong>Web APIの実践編</strong>として、<br><span class="swl-marker mark_orange"><strong>「YouTubeの急上昇の1位の動画タイトルと再生数を取得する」ショートカット</strong>を作成していきます。</span></p>



<p>ついに、【<a href="https://automa-recipe.com/programming_articles/" title="【iOSショートカットで学ぶ】プログラミング教室">iOSショートカットで学ぶ！プログラミング教室</a>】シリーズも<strong>最終回</strong>となりました。</p>



<p>これまで学習してきた内容もフル活用していきますので、今回はフィナーレにふさわしい回になると思います。</p>



<p>ぜひ、最後までご覧ください！</p>



<p>それでは、Let’s プログラミング！</p>



<div class="swell-toc-placeholder"></div>



<h2 class="wp-block-heading" id="今回のショートカットを作成する流れ">今回のショートカットを作成する流れ</h2>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/uploads/2022/02/データ-26.jpg" alt="" class="wp-image-3913" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/データ-26.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-26-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-26-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>まずは、<strong>「YouTubeの急上昇の1位の動画タイトルと再生数を取得する」ショートカットを作成する流れ</strong>をざっくりと掴んでいただきます。</p>



<p>ショートカットでWeb APIを使う方法は以下の通りでした。</p>



<ol class="is-style-check_list wp-block-list"><li>Web APIを探す</li><li>「URLの内容を取得アクション」でデータを取得する</li><li>「辞書の値を取得」アクションでデータを取り出す</li></ol>



<p>前回の記事では、それぞれのステップでやることをざっくりと説明しましたね。</p>



<p>今回も以上の３ステップに沿ってショートカットを作成していきます。</p>



<p>また、<span class="swl-marker mark_yellow">今回のショートカット作りには、パソコンを併用することが望ましいです。</span></p>



<p>特に、Web APIを探すのに使う「<strong><a href="https://api.rakuten.net/">Rakuten Rapid API</a></strong>」というサイトは、モバイル表示すると非常に見にくくなってしまいます。</p>



<p>ですので、<strong><span class="swl-marker mark_orange">「Rakuten Rapid API」というサイトはパソコンで開いていただいて、ショートカット作りはモバイル（もしくはMac）で行ってもらうのが良い</span></strong>と思います。</p>



<p>それでは、Web APIを登録していくところから始めましょう！</p>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5725212284208116"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5725212284208116"
     data-ad-slot="2014468485"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h2 class="wp-block-heading" id="web-apiの登録">Web APIの登録</h2>



<figure class="wp-block-image size-full"><img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/uploads/2022/02/データ-27.png" alt="" class="wp-image-3914" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/データ-27.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-27-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-27-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<h3 class="wp-block-heading" id="rakuten-rapid-apiの会員登録">Rakuten Rapid APIの会員登録</h3>



<p>まずは、「Rakuten Rapid API」というサイトの会員登録をしていきましょう！</p>



<p>① <a href="https://api.rakuten.net/">https://api.rakuten.net/</a> を開き、「新規登録」をタップします。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/1-3-1024x579.jpg" alt="" class="wp-image-3875" width="605" height="341" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/1-3-1024x579.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/1-3-300x170.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/1-3-768x434.jpg 768w, https://automa-recipe.com/wp-content/uploads/2022/02/1-3.jpg 1240w" sizes="(max-width: 605px) 100vw, 605px" /></figure></div>







<p>② 必須項目を入力し、完了</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/2-1-1024x561.png" alt="" class="wp-image-3876" width="592" height="324" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/2-1-1024x561.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/2-1-300x164.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/2-1-768x421.png 768w, https://automa-recipe.com/wp-content/uploads/2022/02/2-1.png 1240w" sizes="(max-width: 592px) 100vw, 592px" /></figure></div>







<h3 class="wp-block-heading" id="youtube-search-and-download-の登録">「Youtube Search and Download」の登録</h3>



<p>それでは、「<strong>Youtube Search and Download</strong>」というWeb APIを登録していきます！</p>



<p>① 検索窓に「Youtube Search and Download」と入力し検索し、一番上のWeb APIを選択します。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/3-1-1024x561.png" alt="" class="wp-image-3877" width="579" height="317" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/3-1-1024x561.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/3-1-300x164.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/3-1-768x421.png 768w, https://automa-recipe.com/wp-content/uploads/2022/02/3-1.png 1240w" sizes="(max-width: 579px) 100vw, 579px" /></figure></div>







<p>② 「登録してテスト」をタップします。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/4-2-1024x561.png" alt="" class="wp-image-3879" width="589" height="323" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/4-2-1024x561.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/4-2-300x164.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/4-2-768x421.png 768w, https://automa-recipe.com/wp-content/uploads/2022/02/4-2.png 1240w" sizes="(max-width: 589px) 100vw, 589px" /></figure></div>







<p>③ Basicのプランを選択して完了です。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/5-1024x561.png" alt="" class="wp-image-3880" width="547" height="300" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/5-1024x561.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/5-300x164.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/5-768x421.png 768w, https://automa-recipe.com/wp-content/uploads/2022/02/5.png 1240w" sizes="(max-width: 547px) 100vw, 547px" /></figure></div>



<p>これでWeb APIの登録は完了です。</p>



<p>すごく簡単ですよね！</p>



<p>ただ、1つ<strong><span class="swl-marker mark_orange">Web APIを使う上で、注意点</span></strong>があります。</p>



<p>それは、<span class="swl-marker mark_orange">使う量に応じて料金がとられることです！</span></p>



<p>今回登録した「<strong>Youtube Search and Download</strong>」では、無料枠だと<strong>1日あたり500回</strong>しか使えないように制限されています。</p>



<p>ですので、使用回数が500回を越えると自動で使えなくなります。</p>



<p>しかし、そういった使用制限をせず、</p>



<p><strong>「はい、10回以上使ったから1000円ね！」</strong></p>



<p>みたいな課金形態のWeb APIもあるので注意です。</p>



<p><strong><span class="swl-marker mark_yellow">Web APIを選定する際には、自分で料金プランや作成者が信頼できるかどうかを見極めることが重要</span></strong>です。</p>



<p>怪しいWeb APIも多く存在するので、よく調べてから使うようにしましょう！</p>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5725212284208116"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5725212284208116"
     data-ad-slot="2014468485"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h2 class="wp-block-heading" id="urlの内容を取得-アクションでデータを取得">「URLの内容を取得」アクションでデータを取得</h2>



<figure class="wp-block-image size-full"><img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/uploads/2022/02/データ-28.jpg" alt="" class="wp-image-3915" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/データ-28.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-28-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-28-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>それでは、ショートカットの作成に移ります。<br>※ 「Rakuten Rapid API」はまだ使うので、閉じないでおきましょう。</p>



<p>「Youtube Search and Download」からYouTube急上昇動画のデータを取得していきましょう！</p>



<p>全部で<strong>9ステップ</strong>です！</p>



<p>詳しい説明は後ほどします！</p>



<p>① 新規ショートカットを作成し、「URLの内容を取得」アクションを追加します。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/6-6.jpeg" alt="" class="wp-image-3881" width="358" height="132" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/6-6.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/6-6-300x111.jpeg 300w" sizes="(max-width: 358px) 100vw, 358px" /></figure></div>







<p>② Rakuten Rapid APIの「Youtube Search and Download」ページの「エンドポイント」の場所に移動します。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/7-1024x553.png" alt="" class="wp-image-3882" width="511" height="276" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/7-1024x553.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/7-300x162.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/7-768x415.png 768w, https://automa-recipe.com/wp-content/uploads/2022/02/7.png 1240w" sizes="(max-width: 511px) 100vw, 511px" /></figure></div>







<p>③ 左バーにある、「GET Trending」をクリックし、右側の「（Node.js）Unirest」というドロップダウンをタップし、「JavaScript」&gt;「fetch」を選択します。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/8-1024x552.jpg" alt="" class="wp-image-3884" width="520" height="280" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/8-1024x552.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/8-300x162.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/8-768x414.jpg 768w, https://automa-recipe.com/wp-content/uploads/2022/02/8.jpg 1240w" sizes="(max-width: 520px) 100vw, 520px" /></figure></div>







<p>④ 真ん中の列「オプションパラメータ」の「type」を”mu”から”n”に、「hl」を”en”から”ja”に、「gl」の”US”を”JP”に変更する。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/9-1024x527.png" alt="" class="wp-image-3885" width="517" height="266" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/9-1024x527.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/9-300x154.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/9-768x395.png 768w, https://automa-recipe.com/wp-content/uploads/2022/02/9.png 1240w" sizes="(max-width: 517px) 100vw, 517px" /></figure></div>







<p>⑤ 右側のコードスニペット内の”https://youtube-search-and-download.p….”と、「x-rapidapi-key」「x-rapidapi-host」それぞれの値をコピー（メモアプリなどで保存）する。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/11-1024x527.png" alt="" class="wp-image-3892" width="614" height="316" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/11-1024x527.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/11-300x154.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/11-768x395.png 768w, https://automa-recipe.com/wp-content/uploads/2022/02/11.png 1240w" sizes="(max-width: 614px) 100vw, 614px" /></figure></div>







<p>⑥ ショートカットの「URLの内容を取得」アクションの”URL”の部分に&#8221;https://youtube-search-download.p&#8230;&#8221;をペーストする。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/12-3.jpeg" alt="" class="wp-image-3893" width="304" height="265" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/12-3.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/12-3-300x262.jpeg 300w" sizes="(max-width: 304px) 100vw, 304px" /></figure></div>







<p>⑦ URLの内容を取得」アクションのヘッダを開き、2つ新規ヘッダを追加して画像のようにして「x-rapidapi-key」「x-rapidapi-host」の値を先をほどコピーしたものに設定する。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/13-3-746x1024.jpeg" alt="" class="wp-image-3894" width="296" height="406" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/13-3-746x1024.jpeg 746w, https://automa-recipe.com/wp-content/uploads/2022/02/13-3-219x300.jpeg 219w, https://automa-recipe.com/wp-content/uploads/2022/02/13-3.jpeg 750w" sizes="(max-width: 296px) 100vw, 296px" /></figure></div>







<p>⑧ 画面右下の実行ボタンを押して、以下のように出力されれば成功です！</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/14-4-746x1024.jpeg" alt="" class="wp-image-3895" width="290" height="398" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/14-4-746x1024.jpeg 746w, https://automa-recipe.com/wp-content/uploads/2022/02/14-4-219x300.jpeg 219w, https://automa-recipe.com/wp-content/uploads/2022/02/14-4.jpeg 750w" sizes="(max-width: 290px) 100vw, 290px" /></figure></div>







<h3 class="wp-block-heading" id="解説">解説</h3>



<p>「とりあえず出来たけど、理解ができなかった」という方が多いのではないでしょうか？</p>



<p>あまり詳細には踏み込みませんが、「<strong>Web APIを使えるようになる」ということを目的</strong>としてざっくりと解説します！</p>



<p>おそらく理解しにくかったのは、以下の「<strong>コードスニペット</strong>」の部分ですよね。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/15-1.png" alt="" class="wp-image-3896" width="406" height="429" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/15-1.png 692w, https://automa-recipe.com/wp-content/uploads/2022/02/15-1-284x300.png 284w" sizes="(max-width: 406px) 100vw, 406px" /></figure></div>







<p>③ で、「（Node.js）Unirest」から「JavaScript」&gt;「(JavaScript) fetch」に変更しましたよね。</p>



<p>「Node.jsとは何か」「fetchとは何か」という難しいことは置いておいて、<br><span class="swl-marker mark_yellow"><strong>「ショートカットでWeb APIを使う時は”(JavaScript) fetch”にする！」</strong>と覚えてしまいましょう。</span></p>



<p>そうして<span class="swl-marker mark_orange">設定された「コードスニペット」の内容は、ショートカットの「URLから内容を取得」アクションの設定項目と対応します。</span></p>



<p>以下の二つの画像を見比べてみてください。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/16-1-edited.png" alt="" class="wp-image-3898" width="442" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/16-1-edited.png 692w, https://automa-recipe.com/wp-content/uploads/2022/02/16-1-edited-300x225.png 300w" sizes="(max-width: 692px) 100vw, 692px" /><figcaption>コードスニペット</figcaption></figure></div>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/17-5.jpeg" alt="" class="wp-image-3899" width="370" height="439" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/17-5.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/17-5-253x300.jpeg 253w" sizes="(max-width: 370px) 100vw, 370px" /><figcaption>URLを取得アクション</figcaption></figure></div>







<p>この事実さえ知っていれば、他のWeb APIを使う時も同様の手順で使えるようになります。</p>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5725212284208116"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5725212284208116"
     data-ad-slot="2014468485"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h2 class="wp-block-heading" id="辞書の値を取得-アクションでデータを取り出す">「辞書の値を取得」アクションでデータを取り出す</h2>



<figure class="wp-block-image size-full"><img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/uploads/2022/02/データ-29.jpg" alt="" class="wp-image-3916" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/データ-29.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-29-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-29-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>「URLを取得」アクションでWeb APIからYouTube動画のデータを取ってくることができました。</p>



<p><a href="https://automa-recipe.com/learn-programming/webapi-dict/" title="Web APIって何？iPhoneショートカットで活用する方法！">前回の記事</a>でも説明したように、<span class="swl-marker mark_yellow">Web APIから取り出したデータは「<strong>辞書</strong>」の形式になっています。</span></p>



<p>Rakuten Rapid APIの「Youtube Search and Download」ページ右側の「<strong>返信例</strong>」というところを見てみましょう。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/18-edited.png" alt="" class="wp-image-3901" width="481" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/18-edited.png 692w, https://automa-recipe.com/wp-content/uploads/2022/02/18-edited-300x225.png 300w" sizes="(max-width: 692px) 100vw, 692px" /></figure></div>



<p>ここでは、Web APIから取り出したデータがどのようなものかを見ることができます。</p>



<p>データを全て開いてみると、以下のようになっています。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/19-1.png" alt="" class="wp-image-3902" width="479" height="523" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/19-1.png 692w, https://automa-recipe.com/wp-content/uploads/2022/02/19-1-275x300.png 275w" sizes="(max-width: 479px) 100vw, 479px" /></figure></div>







<p>何がなんだか分からないと思いますが、既に「辞書」の使い方を理解した皆さんであれば、解読することが可能です。</p>



<p>Web APIのデータは「辞書の形式」と言いましたが、辞書の形式をコードで書くと先ほどの画像のようになるのです。</p>



<p><span class="swl-marker mark_yellow"><strong>コードで書くと「{&nbsp; }」で囲われているのが「辞書」の印</strong>になり、<br><strong>「{キー ： 値}」という書き方</strong></span>になります。</p>



<p>それを踏まえて、今回Web APIから取得したデータを解読していきましょう！</p>



<p class="has-border -border01">・全体のデータが「辞書①」（{&nbsp; }で囲われている）である。<br>・「辞書①」の中に、キーが”contents”で、値が「配列A」となっているデータがある。<br>・「配列A」のインデックスが”0”の値に「辞書②」のデータがある。<br>・「辞書②」の中に、キーが”video”で値が「辞書③」のデータがある。<br>・「辞書③」の中に、様々なキーで動画の情報が入っている。</p>



<p>「配列A」の中にはインデックスが”0”から”14”まで、それぞれの値に辞書入っています。</p>



<p>配列Aのインデックスが”0”の値である辞書には、YouTube急上昇1位のデータが<br>配列Aのインデックスが”1”の値である辞書には、YouTube急上昇2位のデータが<br>配列Aのインデックスが”2”の値である辞書には、YouTube急上昇3位のデータが</p>



<p>入っています。</p>



<p>言葉で言われてもイメージがつきにくいと思うので、</p>



<p>以上の説明を画像やご自身のパソコンでコードを見ながら順に理解していただきたいです。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/20.png" alt="" class="wp-image-3903" width="390" height="338" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/20.png 643w, https://automa-recipe.com/wp-content/uploads/2022/02/20-300x260.png 300w" sizes="(max-width: 390px) 100vw, 390px" /></figure></div>







<p><span class="swl-marker mark_yellow">ポイントは、<strong>「辞書①」の中に、キーが”contents”で、値が「配列A」のデータがある</strong>ということ。</span></p>



<p>そして、<span class="swl-marker mark_yellow"><strong>「配列A」のインデックスが”0”の値が「辞書②」のデータである</strong>ということ</span>です。</p>



<p>「配列..?インデックス？」と忘れてしまった方は、<a href="https://automa-recipe.com/learn-programming/how-repeat/" title="「繰り返す」や「リスト」をiPhoneショートカットで使いこなそう！">第5回</a>や<a href="https://automa-recipe.com/learn-programming/javascript-variable-list/" title="JavaScriptで「変数」と「配列」を扱う方法を学習しよう！">第7回</a>の内容を復習してみてください！</p>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5725212284208116"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5725212284208116"
     data-ad-slot="2014468485"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<p>なんとなくイメージがついたところで、急上昇動画のタイトルと再生回数をショートカットで取り出していきましょう！</p>



<p><a href="https://automa-recipe.com/learn-programming/webapi-dict/" title="Web APIって何？iPhoneショートカットで活用する方法！">前回の記事</a>で、ショートカットで「辞書の中にある辞書の値を取り出す方法」については解説していますので、もし忘れた方は復習してみてください！</p>



<p>たった<strong>２ステップ</strong>で完了です。</p>



<p>① 「辞書の値を取得」アクションを追加し、「”URLの内容”内の”contents.1.video.title”の値を取得」となるよう設定します。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/21-4.jpeg" alt="" class="wp-image-3904" width="344" height="298" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/21-4.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/21-4-300x260.jpeg 300w" sizes="(max-width: 344px) 100vw, 344px" /></figure></div>







<p>② 「辞書の値を取得」アクションを追加し、「”URLの内容”内の”contents.1.video.viewCountText”の値を取得」となるよう設定します。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/22-3-632x1024.jpeg" alt="" class="wp-image-3905" width="333" height="540" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/22-3-632x1024.jpeg 632w, https://automa-recipe.com/wp-content/uploads/2022/02/22-3-185x300.jpeg 185w, https://automa-recipe.com/wp-content/uploads/2022/02/22-3.jpeg 750w" sizes="(max-width: 333px) 100vw, 333px" /></figure></div>



<p>これでYouTubeの急上昇1位の動画のタイトルと再生回数を取得することができました！</p>



<p>ここで補足説明ですが、<br><strong><span class="swl-marker mark_orange">辞書の値となっている配列の中からデータを取り出すときは、キーにその配列のインデックスを指定することで取り出すことができます！</span></strong></p>



<p>図解すると以下の通りです。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/23.png" alt="" class="wp-image-3906" width="525" height="295" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/23.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/23-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/23-768x432.png 768w" sizes="(max-width: 525px) 100vw, 525px" /></figure></div>



<p>そして、ショートカットの「辞書の値を取得」アクション内で<br><strong>”contents.1.video.title”</strong>の箇所を<strong>”contents.0.video.title”</strong>としないのは、<strong><span class="swl-marker mark_yellow">ショートカットのリスト（配列）のインデックスが「1から」だから</span></strong>ですよね！</p>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5725212284208116"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5725212284208116"
     data-ad-slot="2014468485"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h2 class="wp-block-heading" id="ショートカットを完成させよう">ショートカットを完成させよう！</h2>



<p>さて、あとは取得したデータを表示させるだけです！</p>



<p>もうひと頑張りやっていきましょう！</p>



<p>① 「テキスト」アクションを追加し、内容を以下の画像のように設定する。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/24-2-594x1024.jpeg" alt="" class="wp-image-3908" width="258" height="445" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/24-2-594x1024.jpeg 594w, https://automa-recipe.com/wp-content/uploads/2022/02/24-2-174x300.jpeg 174w, https://automa-recipe.com/wp-content/uploads/2022/02/24-2.jpeg 719w" sizes="(max-width: 258px) 100vw, 258px" /></figure></div>







<p>② 「クイックルック」アクションを追加し、「”テキスト”をQuick Lookで表示する」となるように調整する。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/25-594x1024.jpeg" alt="" class="wp-image-3909" width="260" height="448" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/25-594x1024.jpeg 594w, https://automa-recipe.com/wp-content/uploads/2022/02/25-174x300.jpeg 174w, https://automa-recipe.com/wp-content/uploads/2022/02/25.jpeg 719w" sizes="(max-width: 260px) 100vw, 260px" /></figure></div>



<p>これでショートカットの作成は終了です！</p>



<p>実行し、以下のように表示されれば成功です！！</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/26.jpeg" alt="" class="wp-image-3910" width="342" height="216" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/26.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/26-300x190.jpeg 300w" sizes="(max-width: 342px) 100vw, 342px" /></figure></div>







<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5725212284208116"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5725212284208116"
     data-ad-slot="2014468485"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h2 class="wp-block-heading" id="終わりに">終わりに</h2>



<figure class="wp-block-image size-full"><img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/uploads/2022/02/データ-30.jpg" alt="" class="wp-image-3917" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/データ-30.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-30-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-30-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>今回の『Web API』実践編で、【iOSショートカットで学ぶ！ショートカット教室】もフィナーレです！</p>



<p>特にこの「Web API」編はこれまでの総まとめ的な内容だったので、非常に難しかったと思います。</p>



<p><span class="swl-marker mark_yellow">ここまで全ての記事を読んだあなたは、プログラミングの知識が周りの人から頭ひとつ抜けていることは間違いありません。</span></p>



<p>【iOSショートカットで学ぶ！ショートカット教室】シリーズは全11回で、<strong>およそ4万5000文字</strong>もあります。</p>



<p>それを読み切ったこと自体に自信を持っていただきたいです。</p>



<p>むしろ、<span class="swl-marker mark_orange">私の稚拙な説明をここまで読み理解できたのは、あなたに「<strong>プログラミングの素養があるから</strong>」なのかもしれません。</span></p>



<p>もし少しでも「<strong>プログラミングって面白い！</strong>」と思っていただける方が１人でもいたら、このシリーズを書いてよかったと心から思えます。</p>



<p>最後までお読みいただき、本当にありがとうございました！</p>



<p>もしかすると、今後より詳しい内容を発信するシリーズを開始するかもしれませんので、お楽しみに！</p>



<p><strong>それでは、Let’s プログラミング！</strong></p>



<h4 class="wp-block-heading" id="プログラミング教室の記事一覧">プログラミング教室の記事一覧</h4>


<div class="p-postListWrap  "><ul class="p-postList -type-list"><li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/how-to-earn/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【経験談あり】プログラミングの基礎を理解した後、副業で稼ぐ３つの方法を解説！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-06">2022.02.06</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/difference-proggraming/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【超簡単】iPhoneの「ショートカット」アプリでプログラミング学習を始めよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-01-30">2022.01.30</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/three-factors/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">iPhoneショートカットの「スクリプティング」とは？プログラミングの基本3要素を理解しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-01">2022.02.01</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/what-is-variable/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【徹底解説！】「変数」って何？iPhoneショートカットを作りながらマスターしよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-03">2022.02.03</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/how-use-if/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【if文をマスターする！】iPhoneショートカットで条件分岐を完全理解しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-04">2022.02.04</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/how-repeat/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">「繰り返す」や「リスト」をiPhoneショートカットで使いこなそう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-05">2022.02.05</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/iphone-javascript/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">「JavaScript」とは？iPhoneショートカットで実行する方法を徹底解説！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-06">2022.02.06</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/javascript-variable-list/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">JavaScriptで「変数」と「配列」を扱う方法を学習しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-09">2022.02.09</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/javascript-if-for/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">「条件分岐」「繰り返し」をJavaScriptで行う方法を理解しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-11">2022.02.11</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/webapi-dict/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">Web APIって何？iPhoneショートカットで活用する方法！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-13">2022.02.13</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/shortcuts-webapi-practice/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">実践！iPhoneショートカットでWeb APIを使いこなそう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-19">2022.02.19</time>
		</div>
				</div>
			</div>
			</a>
</li>
</ul></div><p>The post <a href="https://automa-recipe.com/learn-programming/shortcuts-webapi-practice/">実践！iPhoneショートカットでWeb APIを使いこなそう！</a> first appeared on <a href="https://automa-recipe.com">オートクック！</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://automa-recipe.com/learn-programming/shortcuts-webapi-practice/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Web APIって何？iPhoneショートカットで活用する方法！</title>
		<link>https://automa-recipe.com/learn-programming/webapi-dict/</link>
					<comments>https://automa-recipe.com/learn-programming/webapi-dict/#comments</comments>
		
		<dc:creator><![CDATA[automa-recipe]]></dc:creator>
		<pubDate>Sun, 13 Feb 2022 04:29:34 +0000</pubDate>
				<category><![CDATA[プログラミング教室]]></category>
		<category><![CDATA[まとめ]]></category>
		<guid isPermaLink="false">https://automa-recipe.com/?p=3819</guid>

					<description><![CDATA[<p><img src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー.png" class="webfeedsFeaturedVisual" /></p><p>みなさん、「Web API」って知っていますか？ 全く知らない、聞いたことがあるけど使ったことがない、という人が多いのではないでしょうか？ Web APIを使いこなすことができれば、ショートカットで出来ることが一気に広が [&#8230;]</p>
<p>The post <a href="https://automa-recipe.com/learn-programming/webapi-dict/">Web APIって何？iPhoneショートカットで活用する方法！</a> first appeared on <a href="https://automa-recipe.com">オートクック！</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><img src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー.png" class="webfeedsFeaturedVisual" /></p><p>みなさん、<strong>「<span class="swl-marker mark_orange">Web API</span>」</strong>って知っていますか？</p>



<p>全く知らない、聞いたことがあるけど使ったことがない、という人が多いのではないでしょうか？</p>



<p><span class="swl-marker mark_yellow">Web APIを使いこなすことができれば、ショートカットで出来ることが一気に広がります。</span></p>



<p>例えば、</p>



<p><strong>・Amazonの価格を調べるツールの作成<br>・YouTubeの急上昇の動画をすぐに取得<br>・ぐるなびの検索機能をショートカット内に組み込む</strong></p>



<p>などです。</p>



<p>本記事では</p>



<ul class="is-style-check_list wp-block-list"><li><strong>そもそもWeb APIとは何か</strong></li><li><strong>iOSショートカットでWebAPIを使う流れ</strong></li><li><strong>WebAPIを使うのに必要な重要アクション</strong></li></ul>



<p>について解説していきます！</p>



<p>【<a href="https://automa-recipe.com/programming_articles/" title="【iOSショートカットで学ぶ】プログラミング教室">iOSショートカットで学ぶ！プログラミング教室</a>】今回で最終回&#8230;と言いたいところだったのですが、<span class="swl-marker mark_yellow">「Web API」編は「<strong>知識編</strong>」と「<strong>実践編</strong>」の2部構成にすることにしました！</span></p>



<p>「Web API」編はプログラミングの初心者さんには理解が難しいところが多くなってしまうかもしれません。</p>



<p>しかし、<span class="swl-marker mark_orange"><strong>「Web APIを使える」ということを目的</strong>として、なるべく分かりやすく専門用語は使わない方針で進めていきます</span>ので、ぜひ最後までご覧ください！</p>



<p>それでは、Let’s プログラミング！</p>



<div class="swell-toc-placeholder"></div>



<h2 class="wp-block-heading" id="web-apiとは">Web APIとは</h2>



<figure class="wp-block-image size-full"><img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/uploads/2022/02/データ-24.png" alt="" class="wp-image-3850" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/データ-24.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-24-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-24-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>まずは、Web APIとは何かを解説していきます。</p>



<p><span class="swl-marker mark_yellow">Web APIとは、すごく簡単に言うと「<strong>画面のないアプリ</strong>」のことです。</span></p>



<p>普通のアプリだったら、画面がありますよね？</p>



<p>画面の中にあるボタンなどをタップしたり、フォーム内にテキストを入力したりすることで、<br>・検索<br>・投稿<br>・いいね<br>などのアプリの機能が使えるわけです。</p>



<p>一方で、Web APIでは画面をタップしたりテキスト入力したりすることなく、これらの機能が使えます。</p>



<p><span class="swl-marker mark_orange">私たち人間がアプリの画面上でタップやテキスト入力などをする代わりに、<strong>コンピューターが自動でアプリの機能を使ってくれるイメージ</strong>です。</span></p>



<p>ショートカットでは、リマインダーやLINEなどのアプリ画面を開くことなく「アクション」を使ってアプリの機能を使うことができますよね。</p>



<p>Web APIを使っても、同じように「アプリの画面を開かず、アプリの機能を使える」ということができます。</p>



<p><strong>人間が1からアプリの画面を操作したりするよりも、コンピューターが自動で操作してくれた方が楽ですし早い</strong>ですよね。</p>



<p>そのため実は、<span class="swl-marker mark_orange">YouTubeやLINEなどの「画面があるアプリ」も、コンピューターが自動で操作するための「画面のないアプリ」（Web API）が用意されていることが多い</span>です。</p>



<p><strong><span class="swl-marker mark_yellow">「画面がない、コンピューター用のアプリ」が「Web API」</span></strong>と考えていただければと思います。</p>



<p>※イメージです。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/1-2.png" alt="" class="wp-image-3820" width="621" height="349" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/1-2.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/1-2-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/1-2-768x432.png 768w" sizes="(max-width: 621px) 100vw, 621px" /></figure></div>







<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5725212284208116"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5725212284208116"
     data-ad-slot="2014468485"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h2 class="wp-block-heading" id="ショートカットでweb-apiを使う方法">ショートカットでWeb APIを使う方法</h2>



<p>Web APIがどのようなものか、ざっくりと理解できましたでしょうか？</p>



<p>使い慣れて初めて分かる部分もあると思いますので、とりあえず先に進みながら理解を深めていきましょう。</p>



<p>ここでは、ショートカットでWeb APIを使う方法を解説します。</p>



<p>おおまかな流れは以下の通りです。</p>



<ol class="is-style-check_list wp-block-list"><li><strong>Web APIを探す</strong></li><li><strong>「URLの内容を取得アクション」でデータを取得する</strong></li><li><strong>「辞書の値を取得」アクションでデータを取り出す</strong></li></ol>



<h3 class="wp-block-heading" id="web-apiを探す">Web APIを探す</h3>



<p>まずは、使いたいWeb APIを探しましょう。</p>



<p>Web APIを探せるサイトは沢山ありますが、ここでは最もポピュラーな「<a href="https://api.rakuten.net/" title="https://api.rakuten.net/">Rakuten Rapid API</a>」で探していきましょう。</p>



<p>以下のように「<a href="https://api.rakuten.net/">Rakuten Rapid API</a>」では無料で便利なWeb APIがたくさん使えるようになっています。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/2-1-1024x595.jpg" alt="" class="wp-image-3821" width="609" height="353" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/2-1-1024x595.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/2-1-300x174.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/2-1-768x447.jpg 768w, https://automa-recipe.com/wp-content/uploads/2022/02/2-1.jpg 1240w" sizes="(max-width: 609px) 100vw, 609px" /></figure></div>







<p>使いたいWeb APIをクリックしてみると、以下のような画面になります。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/3-1-1024x579.jpg" alt="" class="wp-image-3822" width="605" height="341" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/3-1-1024x579.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/3-1-300x170.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/3-1-768x434.jpg 768w, https://automa-recipe.com/wp-content/uploads/2022/02/3-1.jpg 1240w" sizes="(max-width: 605px) 100vw, 605px" /></figure></div>



<p><strong><span class="swl-marker mark_yellow">W</span></strong><span class="swl-marker mark_yellow"><strong>eb APIの使い方や料金</strong>などがこの画面で確認でき、<strong>登録</strong>することが可能です</span>！</p>



<p>詳しい画面の見方や手順は次回の実践編で解説しますが、もし興味がある方は色々物色してみてください！</p>



<h3 class="wp-block-heading" id="urlの内容を取得-アクションでデータを取得する"><strong>「URLの内容を取得</strong>」<strong>アクションでデータを取得する</strong></h3>



<p><span class="swl-marker mark_orange">使いたいWeb APIが決まったら、ショートカットの作成を始めます。</span></p>



<p>まず使うのが<strong>「URLの内容を取得」</strong>アクションです。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/4-5.jpeg" alt="" class="wp-image-3823" width="346" height="143" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/4-5.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/4-5-300x124.jpeg 300w" sizes="(max-width: 346px) 100vw, 346px" /></figure></div>







<p>「URLの内容を取得」アクションをショートカット内に追加し、アクションの中身を開いてみましょう。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/5-5.jpeg" alt="" class="wp-image-3827" width="353" height="81" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/5-5.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/5-5-300x69.jpeg 300w" sizes="(max-width: 353px) 100vw, 353px" /></figure></div>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/6-5.jpeg" alt="" class="wp-image-3828" width="355" height="164" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/6-5.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/6-5-300x138.jpeg 300w" sizes="(max-width: 355px) 100vw, 355px" /></figure></div>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/7-7.jpeg" alt="" class="wp-image-3829" width="356" height="206" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/7-7.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/7-7-300x173.jpeg 300w" sizes="(max-width: 356px) 100vw, 356px" /><figcaption>全て開かれた状態</figcaption></figure></div>



<p>このアクションを使って、Web APIに接続しデータを取得していきます。</p>



<p>詳しくは次回の実践編で手を動かしながら理解していきますが、<strong>Web APIからデータを取得する流れ</strong>をざっくりと説明しておきます。</p>



<ol class="is-style-check_list wp-block-list"><li>「”URL”の内容を取得」の”URL”の部分に、使いたいWeb APIのURLを入れる。</li><li>アクション内2行目の「方法」を決める。（GET? POST?&#8230;）</li><li>アクション内3行目の「ヘッダ」などに色々なデータを入れる。</li></ol>



<p>今は全くイメージが掴めないと思いますが、問題ありません。</p>



<p>とりあえず、<span class="swl-marker mark_yellow"><strong>「URLの内容を取得」というアクションを使ってWeb APIからデータを取ってくる</strong>ということだけ覚えておいてください！</span></p>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5725212284208116"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5725212284208116"
     data-ad-slot="2014468485"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h3 class="wp-block-heading" id="辞書の値を取得-アクションでデータを取り出す"><strong>「辞書の値を取得」アクションでデータを取り出す</strong></h3>



<p><span class="swl-marker mark_orange">「URLの内容を取得」アクションを使ってWeb APIから取得したデータは「<strong>辞書</strong>」形式のデータになっています。</span></p>



<p>そこで<strong>「辞書の値を取得」アクション</strong>を使い、取得したデータをショートカット内で活用していきます。</p>



<p>「まず、”辞書の形式のデータ”が分からないのですが&#8230;」</p>



<p>という方も多いと思います。</p>



<p>そこで、まずは「辞書」形式のデータについて解説しておきましょう。</p>



<h4 class="wp-block-heading" id="辞書-形式のデータとは">「辞書」形式のデータとは？</h4>



<p><span class="swl-marker mark_yellow">「辞書」形式のデータとは、<strong>”キー”と”値”がセットで保存されているデータ</strong>のことです。</span></p>



<p>「<strong>“キー”と”値”がセット</strong>」と言われてもよく分からないですよね。</p>



<p>ここで思い出して欲しいのが「<strong>変数</strong>」です。</p>



<p><span class="swl-marker mark_orange">変数は</span>、箱に名前をつけて値（データ）を保存していましたね。</p>



<p><span class="swl-marker mark_orange">“変数の名前”と”値”をセットで保存していた</span>わけです。</p>



<p>“<span class="swl-marker mark_green">キー</span>”とは、<span class="swl-marker mark_green">変数で言うと「変数の名前」</span><br>“<span class="swl-marker mark_blue">値</span>”とは、<span class="swl-marker mark_blue">変数で言うと「変数の中に入れる値（データ）」</span><br>と言えるでしょう。</p>



<p>そして、<strong><span class="swl-marker mark_yellow">「辞書」は”キー”と”値”がセットで保存されるデータを複数保存できます</span></strong>。</p>



<p><strong>変数が辞書の中に複数保存されるイメージ</strong>です。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/10.png" alt="" class="wp-image-3833" width="666" height="375" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/10.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/10-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/10-768x432.png 768w" sizes="(max-width: 666px) 100vw, 666px" /></figure></div>







<p><span class="swl-marker mark_orange">辞書の中に入っているデータは、”キー”指定すれば取り出すことができます</span>。</p>



<p>以下のような辞書が用意されていた場合、</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/11-4.jpeg" alt="" class="wp-image-3834" width="423" height="288" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/11-4.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/11-4-300x204.jpeg 300w" sizes="(max-width: 423px) 100vw, 423px" /></figure></div>



<p>辞書から“<strong>名前”</strong>というキーを指定すれば「<strong>山田</strong>」、</p>



<p>“<strong>住所</strong>”というキーを指定すれば「<strong>東京</strong>」、</p>



<p>“<strong>職業</strong>”と言うキーを指定すれば「<strong>学生</strong>」というデータが取れます。</p>



<p><span class="swl-marker mark_yellow">「<strong>変数のようなものを複数保存できるのが辞書だ</strong>」</span>と覚えてもらって差し支えないでしょう。</p>



<h4 class="wp-block-heading" id="ショートカットで辞書の値を取り出す">ショートカットで辞書の値を取り出す</h4>



<p><span class="swl-marker mark_orange">ショートカットで「辞書」形式のデータを取り出すには、<strong>「辞書の値を取得」アクション</strong>を使います。</span></p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/13-2.jpeg" alt="" class="wp-image-3836" width="374" height="128" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/13-2.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/13-2-300x102.jpeg 300w" sizes="(max-width: 374px) 100vw, 374px" /></figure></div>







<p>データを取り出す具体例を見てみましょう。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/14-3.jpeg" alt="" class="wp-image-3837" width="378" height="387" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/14-3.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/14-3-293x300.jpeg 293w" sizes="(max-width: 378px) 100vw, 378px" /></figure></div>



<p>「辞書の値を取得」アクションで、<span class="swl-marker mark_yellow">キーの部分に”名前”と指定することで、上の辞書から「山田」と言うデータを取得することができました。</span></p>



<p>一見難しそうに感じる辞書ですが、使い慣れると簡単に扱うことができます。</p>



<h4 class="wp-block-heading" id="辞書の入れ子">辞書の入れ子</h4>



<p>また、<strong><span class="swl-marker mark_yellow">「辞書の値に新たに辞書を入れ込むことができる</span>」</strong>ということも覚えておきましょう。</p>



<p>まずは、こちらのイメージ図を見ていただきたいです。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/12-2.png" alt="" class="wp-image-3838" width="686" height="386" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/12-2.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/12-2-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/12-2-768x432.png 768w" sizes="(max-width: 686px) 100vw, 686px" /></figure></div>



<p>「辞書1」の”キーA”とセットになっている<strong>値が「辞書2」</strong>になっていることが分かります。</p>



<p><span class="swl-marker mark_orange"><strong>「辞書1」の”キーA”を指定することで、「辞書2」全体（”キー”と”値”がセットになっている複数のデータ）を取り出すことが出来る</strong>というわけです。</span></p>



<p>では、このように<span class="swl-marker mark_yellow">辞書が入れ子になっている状態でデータを取り出すにはどうすれば良いのでしょうか？</span></p>



<p>こちらも具体例で考えます。</p>



<p>以下のような「辞書」を事例として考えます。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/15.png" alt="" class="wp-image-3839" width="725" height="408" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/15.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/15-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/15-768x432.png 768w" sizes="(max-width: 725px) 100vw, 725px" /></figure></div>



<p>「辞書1」の”名前”というキーとセットになっている値が「辞書2」になっていて、「辞書2」の中には「日本人：山田」「アメリカ人：マイケル」という”キー”と”値”がセットになった複数のデータが辞書として格納されています。</p>



<p>ショートカットでこのような「辞書」を再現すると、以下のようになります。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/16-2.jpeg" alt="" class="wp-image-3840" width="395" height="272" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/16-2.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/16-2-300x207.jpeg 300w" sizes="(max-width: 395px) 100vw, 395px" /><figcaption>辞書1</figcaption></figure></div>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/17-2.jpeg" alt="" class="wp-image-3841" width="392" height="265" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/17-2.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/17-2-300x203.jpeg 300w" sizes="(max-width: 392px) 100vw, 392px" /><figcaption>辞書2（画像1枚目の赤四角をタップすると出る画面）</figcaption></figure></div>







<p>ここで、辞書2から「<strong>マイケル</strong>」という値を取り出したいとしましょう。</p>



<p>「辞書の値を取得」アクションを追加し、以下のように設定します。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/18-2.jpeg" alt="" class="wp-image-3844" width="385" height="453" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/18-2.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/18-2-255x300.jpeg 255w" sizes="(max-width: 385px) 100vw, 385px" /></figure></div>







<p>キーのところに「<strong>名前.アメリカ人</strong>」と設定していますね。</p>



<p>これで辞書2の中の「マイケル」という値を取り出すことができました。</p>



<p>このように<strong><span class="swl-marker mark_yellow">「.」で</span></strong><span class="swl-marker mark_yellow"><strong>キーを繋げてあげることによって、辞書内にある辞書の値を取り出すことができる</strong>のです。</span></p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/データのコピーのコピー.png" alt="" class="wp-image-3846" width="581" height="327" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/データのコピーのコピー.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/データのコピーのコピー-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/データのコピーのコピー-768x432.png 768w" sizes="(max-width: 581px) 100vw, 581px" /></figure></div>



<p>辞書が入れ子状態になっている時の値の取り出し方はざっくりと理解できましたでしょうか？</p>



<p><span class="swl-marker mark_orange">Web APIから取得したデータは、「辞書が入れ子」状態になっているデータがほとんどです。</span></p>



<p>最初は辞書を扱うのに苦労すると思いますが、この苦労を乗り越えた先に待っている景色は素晴らしいものです。</p>



<p>この「辞書の値を取得」アクションを使ってデータを適切に取り出せるようになることで、「Web API」を最大限活用できるようになるからです。</p>



<p>これで、<strong>「ショートカットでWeb APIを使う方法」</strong>概要の説明を終わります！</p>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5725212284208116"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5725212284208116"
     data-ad-slot="2014468485"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h2 class="wp-block-heading" id="終わりに">終わりに</h2>



<figure class="wp-block-image size-full"><img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/uploads/2022/02/データ-25.jpg" alt="" class="wp-image-3851" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/データ-25.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-25-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-25-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>今回は、</p>



<ul class="is-style-check_list wp-block-list"><li><strong>Web APIとは何か</strong></li><li><strong>「ショートカットでWeb APIを使う方法」の概要</strong></li></ul>



<p>について解説してきました。</p>



<p>知らない単語が多く出てきて困ってしまった方も多いと思います。</p>



<p>もし今回の内容が全て理解できていなくても、落ち込まないでください。</p>



<p>知らないことを身につけようと思った時は、必ず相応の時間がかかるものです。</p>



<p>ゆっくりと時間をかけて、知識を習得していきましょう！</p>



<p>次回、<strong><span class="swl-marker mark_yellow">実践編で「Web API」を使ってショートカットを実際に作成していきます。</span></strong></p>



<p>ついに【iOSショートカットで学ぶ！プログラミング教室】<strong>最終回</strong>です&#8230;！</p>



<p>手を動かす中で今回の内容が頭に入ることも多いと思いますので、ぜひチャレンジしてみてください！</p>



<h4 class="wp-block-heading" id="プログラミング教室の記事一覧">プログラミング教室の記事一覧</h4>


<div class="p-postListWrap  "><ul class="p-postList -type-list"><li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/how-to-earn/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【経験談あり】プログラミングの基礎を理解した後、副業で稼ぐ３つの方法を解説！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-06">2022.02.06</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/difference-proggraming/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【超簡単】iPhoneの「ショートカット」アプリでプログラミング学習を始めよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-01-30">2022.01.30</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/three-factors/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">iPhoneショートカットの「スクリプティング」とは？プログラミングの基本3要素を理解しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-01">2022.02.01</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/what-is-variable/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【徹底解説！】「変数」って何？iPhoneショートカットを作りながらマスターしよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-03">2022.02.03</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/how-use-if/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【if文をマスターする！】iPhoneショートカットで条件分岐を完全理解しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-04">2022.02.04</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/how-repeat/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">「繰り返す」や「リスト」をiPhoneショートカットで使いこなそう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-05">2022.02.05</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/iphone-javascript/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">「JavaScript」とは？iPhoneショートカットで実行する方法を徹底解説！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-06">2022.02.06</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/javascript-variable-list/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">JavaScriptで「変数」と「配列」を扱う方法を学習しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-09">2022.02.09</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/javascript-if-for/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">「条件分岐」「繰り返し」をJavaScriptで行う方法を理解しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-11">2022.02.11</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/webapi-dict/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">Web APIって何？iPhoneショートカットで活用する方法！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-13">2022.02.13</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/shortcuts-webapi-practice/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">実践！iPhoneショートカットでWeb APIを使いこなそう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-19">2022.02.19</time>
		</div>
				</div>
			</div>
			</a>
</li>
</ul></div><p>The post <a href="https://automa-recipe.com/learn-programming/webapi-dict/">Web APIって何？iPhoneショートカットで活用する方法！</a> first appeared on <a href="https://automa-recipe.com">オートクック！</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://automa-recipe.com/learn-programming/webapi-dict/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>JavaScriptの実践編！関数とメソッドについても解説！</title>
		<link>https://automa-recipe.com/learn-programming/javascript-code-write/</link>
					<comments>https://automa-recipe.com/learn-programming/javascript-code-write/#respond</comments>
		
		<dc:creator><![CDATA[automa-recipe]]></dc:creator>
		<pubDate>Sat, 12 Feb 2022 03:46:56 +0000</pubDate>
				<category><![CDATA[プログラミング教室]]></category>
		<category><![CDATA[まとめ]]></category>
		<guid isPermaLink="false">https://automa-recipe.com/?p=3793</guid>

					<description><![CDATA[<p><img src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピー.png" class="webfeedsFeaturedVisual" /></p><p>【iOSショートカットで学ぶ！プログラミング教室】これまで3回に渡って解説してきたJavaScript編もいよいよクライマックスです！ 今回は、実際にJavaScriptでコードを書いて実行し、補足として「関数」と「メソ [&#8230;]</p>
<p>The post <a href="https://automa-recipe.com/learn-programming/javascript-code-write/">JavaScriptの実践編！関数とメソッドについても解説！</a> first appeared on <a href="https://automa-recipe.com">オートクック！</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><img src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピー.png" class="webfeedsFeaturedVisual" /></p><p>【<a href="https://automa-recipe.com/programming_articles/" title="【iOSショートカットで学ぶ】プログラミング教室">iOSショートカットで学ぶ！プログラミング教室</a>】これまで3回に渡って解説してきたJavaScript編もいよいよクライマックスです！</p>



<p>今回は、実際にJavaScriptでコードを書いて実行し、補足として<strong>「関数」</strong>と<strong>「メソッド」</strong>についても解説していきます。</p>



<p><span class="swl-marker mark_orange">これまでの内容をフル活用&amp;新しい知識を習得していく</span>ので、もし過去の記事を見ていない方がいらっしゃれば、先にそちらをご覧ください！</p>


<div class="swell-block-postLink" data-style="card">			<a href="https://automa-recipe.com/learn-programming/iphone-javascript/" class="p-blogCard -internal" data-type="type3">
			<div class="p-blogCard__inner">
				<span class="p-blogCard__caption">あわせて読みたい</span>
				<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1-300x169.png" alt="" class="c-postThumb__img -no-lb"></figure></div>				<div class="p-blogCard__body">
					<span class="p-blogCard__title">「JavaScript」とは？iPhoneショートカットで実行する方法を徹底解説！</span>
					<span class="p-blogCard__excerpt">iOSやMacで使えるショートカットアプリは、JavaScriptを実行できる。 そのようなことを聞いても 「なんとなく凄いのは分かるけど、イマイチ何ができるのか分からない…」&#8230;</span>				</div>
			</div></a>
		</div>

<div class="swell-block-postLink" data-style="card">			<a href="https://automa-recipe.com/learn-programming/javascript-variable-list/" class="p-blogCard -internal" data-type="type3">
			<div class="p-blogCard__inner">
				<span class="p-blogCard__caption">あわせて読みたい</span>
				<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2-300x169.png" alt="" class="c-postThumb__img -no-lb"></figure></div>				<div class="p-blogCard__body">
					<span class="p-blogCard__title">JavaScriptで「変数」と「配列」を扱う方法を学習しよう！</span>
					<span class="p-blogCard__excerpt">JavaScriptなどのプログラミング言語を0から学ぼうとすると、とても大変です。 知らない概念が多く、新しく覚えなければならないことが沢山あるからです。 しかし、【iO&#8230;</span>				</div>
			</div></a>
		</div>

<div class="swell-block-postLink" data-style="card">			<a href="https://automa-recipe.com/learn-programming/javascript-if-for/" class="p-blogCard -internal" data-type="type3">
			<div class="p-blogCard__inner">
				<span class="p-blogCard__caption">あわせて読みたい</span>
				<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3-300x169.png" alt="" class="c-postThumb__img -no-lb"></figure></div>				<div class="p-blogCard__body">
					<span class="p-blogCard__title">「条件分岐」「繰り返し」をJavaScriptで行う方法を理解しよう！</span>
					<span class="p-blogCard__excerpt">【iOSショートカットで学ぶ！プログラミング教室】の第8回となった今回は、 JavaScriptで「条件分岐」「繰り返し」を行う方法を学習していきます。 プログラミングの基&#8230;</span>				</div>
			</div></a>
		</div>


<p>それでは、Let’s プログラミング！</p>



<div class="swell-toc-placeholder"></div>



<h2 class="wp-block-heading" id="ショートカットを作成しよう">ショートカットを作成しよう！</h2>



<figure class="wp-block-image size-full"><img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/uploads/2022/02/データ-21.jpg" alt="" class="wp-image-3812" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/データ-21.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-21-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-21-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>それでは、JavaScriptを使ってショートカットを作成していきましょう！</p>



<p>今回作るショートカットは、<strong>「Webページの見出しの内容を取得する」ショートカット</strong>です！</p>



<p>JavaScriptのコードを書くのは後回しにして、<span class="swl-marker mark_yellow">ショートカットの雛形だけ先に作っておきましょう！</span></p>



<p>① 新規ショートカットの作成画面から「アクションを追加」を選択し、検索欄に「WebページでJavaScriptを実行」と入力しアクションを追加します。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/1-2.jpeg" alt="" class="wp-image-3794" width="273" height="228" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/1-2.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/1-2-300x251.jpeg 300w" sizes="(max-width: 273px) 100vw, 273px" /></figure></div>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/2-4-599x1024.jpeg" alt="" class="wp-image-3795" width="269" height="460" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/2-4-599x1024.jpeg 599w, https://automa-recipe.com/wp-content/uploads/2022/02/2-4-175x300.jpeg 175w, https://automa-recipe.com/wp-content/uploads/2022/02/2-4.jpeg 725w" sizes="(max-width: 269px) 100vw, 269px" /></figure></div>







<p>② 「”Webページ”に対してJavaScriptを実行」の”Webページ”をタップし、「ショートカットの入力」を選択します。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/3-4-594x1024.jpeg" alt="" class="wp-image-3797" width="265" height="457" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/3-4-594x1024.jpeg 594w, https://automa-recipe.com/wp-content/uploads/2022/02/3-4-174x300.jpeg 174w, https://automa-recipe.com/wp-content/uploads/2022/02/3-4.jpeg 719w" sizes="(max-width: 265px) 100vw, 265px" /></figure></div>







<p>③ 「”指定なし”から”任意”の入力を受け取る」の”指定なし”をタップし、「共有シートに表示」をオンにする。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/4-4-600x1024.jpeg" alt="" class="wp-image-3799" width="269" height="459" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/4-4-600x1024.jpeg 600w, https://automa-recipe.com/wp-content/uploads/2022/02/4-4-176x300.jpeg 176w, https://automa-recipe.com/wp-content/uploads/2022/02/4-4.jpeg 726w" sizes="(max-width: 269px) 100vw, 269px" /></figure></div>







<p>④ 検索欄に「クイックルック」と入力しアクションを追加します。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/5-3-594x1024.jpeg" alt="" class="wp-image-3800" width="270" height="465" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/5-3-594x1024.jpeg 594w, https://automa-recipe.com/wp-content/uploads/2022/02/5-3-174x300.jpeg 174w, https://automa-recipe.com/wp-content/uploads/2022/02/5-3.jpeg 719w" sizes="(max-width: 270px) 100vw, 270px" /></figure></div>







<p>⑤ 最後のアクションが「”JavaScript”の結果をQuick Lookで表示」となっているのを確認し、ショートカットの名前とアイコンを設定します。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/6-3-594x1024.jpeg" alt="" class="wp-image-3801" width="269" height="464" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/6-3-594x1024.jpeg 594w, https://automa-recipe.com/wp-content/uploads/2022/02/6-3-174x300.jpeg 174w, https://automa-recipe.com/wp-content/uploads/2022/02/6-3.jpeg 719w" sizes="(max-width: 269px) 100vw, 269px" /></figure></div>



<p>これで、ショートカットの雛形はできました！</p>



<h3 class="wp-block-heading" id="javascriptのコードを設定しよう">JavaScriptのコードを設定しよう！</h3>



<p>続いて、「WebページでJavaScriptを実行」アクションにデフォルトで入っているコードを書き換えていきましょう！</p>



<p>① まずは、「WebページでJavaScriptを実行」アクションにデフォルトで入っているコードを削除してください。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/7-5.jpeg" alt="" class="wp-image-3804" width="267" height="246" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/7-5.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/7-5-300x276.jpeg 300w" sizes="(max-width: 267px) 100vw, 267px" /></figure></div>







<p>② 続いて、以下のコードをコピーしてください。</p>



<p><code>var result = [];<br><br>// ページ内の見出しを取得<br>var elements = document.querySelectorAll("h2");<br>if (elements.length &lt; 30) {<br><br>    for (var element of elements) {<br>        result.push(element.innerText);<br>    }<br><br>} else {<br>    var message = "要素が多すぎます";<br>    result.push(message);<br>}<br><br>// completionを呼び出して終了<br>completion(result);</code></p>



<p>③ コピーしたコードを、「WebページでJavaScriptを実行」アクション内にペーストします。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/8-3-594x1024.jpeg" alt="" class="wp-image-3805" width="267" height="460" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/8-3-594x1024.jpeg 594w, https://automa-recipe.com/wp-content/uploads/2022/02/8-3-174x300.jpeg 174w, https://automa-recipe.com/wp-content/uploads/2022/02/8-3.jpeg 719w" sizes="(max-width: 267px) 100vw, 267px" /></figure></div>



<p>これで、JavaScriptのコードの準備も完了です！</p>



<p><span class="swl-marker mark_orange">コードをざっと見ただけでも、これまで学習してきた内容が組み合わさっているのが分かるのではないでしょうか？</span></p>



<p>とはいえ、知らないこともたくさん出てきていると思います。</p>



<p>コードの解説は後ほど詳しくしていきますので、現段階では<br><strong>「これは変数で…これはfor文か…」</strong><br>みたいな感じで軽く目を通しておいていただければ大丈夫です！</p>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5725212284208116"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5725212284208116"
     data-ad-slot="2014468485"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h3 class="wp-block-heading" id="ショートカットを実行してみよう">ショートカットを実行してみよう！</h3>



<p>では、ショートカットを実行してみましょう！</p>



<p>① Safariで適当なWebページを開き、「共有」ボタンをタップします。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/9-3-594x1024.jpeg" alt="" class="wp-image-3806" width="266" height="459" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/9-3-594x1024.jpeg 594w, https://automa-recipe.com/wp-content/uploads/2022/02/9-3-174x300.jpeg 174w, https://automa-recipe.com/wp-content/uploads/2022/02/9-3.jpeg 719w" sizes="(max-width: 266px) 100vw, 266px" /></figure></div>







<p>② 下にスクロールし、先ほど作成したショートカットをタップしてください。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/10-4-597x1024.jpeg" alt="" class="wp-image-3807" width="266" height="456" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/10-4-597x1024.jpeg 597w, https://automa-recipe.com/wp-content/uploads/2022/02/10-4-175x300.jpeg 175w, https://automa-recipe.com/wp-content/uploads/2022/02/10-4.jpeg 723w" sizes="(max-width: 266px) 100vw, 266px" /></figure></div>







<p>③ アクセス許可画面ができるので、「許可」をタップします。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/11-3-589x1024.jpeg" alt="" class="wp-image-3808" width="266" height="462" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/11-3-589x1024.jpeg 589w, https://automa-recipe.com/wp-content/uploads/2022/02/11-3-173x300.jpeg 173w, https://automa-recipe.com/wp-content/uploads/2022/02/11-3.jpeg 713w" sizes="(max-width: 266px) 100vw, 266px" /></figure></div>







<p>④ 開いているWebページの見出しが出るor”要素が多すぎます”と出ていれば成功です。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/12-2-592x1024.jpeg" alt="" class="wp-image-3809" width="270" height="467" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/12-2-592x1024.jpeg 592w, https://automa-recipe.com/wp-content/uploads/2022/02/12-2-173x300.jpeg 173w, https://automa-recipe.com/wp-content/uploads/2022/02/12-2.jpeg 717w" sizes="(max-width: 270px) 100vw, 270px" /></figure></div>



<p>もし、上手くいかない場合は以下からショートカットをダウンロードしてみてください！</p>



<p><a href="https://www.icloud.com/shortcuts/4f65b94635ca4b39a751848b8187e0e6">「Webページの見出しの内容を取得する」ショートカット</a></p>



<p>また、ショートカットでJavaScriptを実行する設定をしていない方は<a href="https://automa-recipe.com/learn-programming/iphone-javascript/" title="「JavaScript」とは？iPhoneショートカットで実行する方法を徹底解説！">第6回の記事</a>をご参照くださいませ！</p>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5725212284208116"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5725212284208116"
     data-ad-slot="2014468485"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h2 class="wp-block-heading" id="コードの解説">コードの解説</h2>



<figure class="wp-block-image size-full"><img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/uploads/2022/02/データ-22.jpg" alt="" class="wp-image-3813" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/データ-22.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-22-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-22-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>では、このショートカットで使ったコードの解説をしていきます。</p>



<p><code>var result = [];<br><br>// ページ内の見出しを取得<br>var elements = document.querySelectorAll("h2");<br>if (elements.length &lt; 30) {<br><br>    for (var element of elements) {<br>        result.push(element.innerText);<br>    }<br><br>} else {<br>    var message = "要素が多すぎます";<br>    result.push(message);<br>}<br><br>// completionを呼び出して終了<br>completion(result);</code></p>



<p>上から順番に解説していきます。</p>



<h3 class="wp-block-heading" id="1行目">1行目</h3>



<p><code>var result = [];</code><br>これは「result」という名前の配列を設定しています。</p>



<p>配列については<a href="https://automa-recipe.com/learn-programming/javascript-variable-list/" title="JavaScriptで「変数」と「配列」を扱う方法を学習しよう！">第7回</a>で詳しく説明したので、ここは問題ないかと思います。</p>



<h3 class="wp-block-heading" id="2行目">2行目</h3>



<p><code> // ページ内の見出しを取得</code></p>



<p><strong>「めちゃめちゃ日本語書いてある…」</strong><br>と驚いたかもしれません。</p>



<p>文章の前に「<strong>//</strong>」がありますよね。</p>



<p><span class="swl-marker mark_yellow">これは「この行はプログラムとして認識しなくてOKです！」という印です。</span></p>



<p>コードの説明を書く際によく利用します。</p>



<p><span class="swl-marker mark_orange">このように「//」を使って、プログラムとして認識させないようにすることを<strong>「コメントアウト」</strong>と言います。</span></p>



<p>コメントアウトを使えると、自分の書いたコードを読みやすくしたり、時間が経って見直した時に思い出しやすくなったりするので便利です。</p>



<p>コメントアウト、ぜひ覚えておきましょう！</p>



<h3 class="wp-block-heading" id="3行目">3行目</h3>



<p><code>var elements = document.querySelectorAll("h2");</code></p>



<p>これは一瞬理解に苦しむと思います。</p>



<p>特に右側ですよね。<br><code>document.querySelectorAll("h2")</code></p>



<p>ここでは、<span class="swl-marker mark_yellow">JavaScriptに元々備わっている機能を使ってWebページ上から見出しの要素を取得しています</span>。</p>



<p>色々と説明したいところではあるのですが、今は<strong>「お決まりの書き方」</strong>として捉えていただければと思います。</p>



<p>そして、<strong>右側で取得した要素を「elements」という名前の配列として設定している</strong>というわけです。</p>



<p>※ document.querySelectorAll(&#8220;h2&#8221;) は 複数の値が取得されるので、変数ではなく「配列」として設定できます。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/13.png" alt="" class="wp-image-3810" width="431" height="83" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/13.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/13-300x59.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/13-768x150.png 768w" sizes="(max-width: 431px) 100vw, 431px" /></figure></div>







<h3 class="wp-block-heading" id="4行目-13行目-if文">4行目-13行目 if文</h3>



<p><code>if (elements.length &lt; 30) {<br><br>    for (var element of elements) {<br>        result.push(element.innerText);<br>    }<br><br>} else {<br>    var message = "要素が多すぎます";<br>    result.push(message);<br>}</code></p>



<p>ここでは、if文とfor文が組み合わさっています。</p>



<p>一旦、<strong>if文の中身は無視して考える</strong>と、こうなります。<br><code>if (elements.length &lt; 30) {<br>    処理A<br>} else {<br>    処理B<br>}</code></p>



<p>if文の条件に「<strong>elements.length &lt; 30</strong>」とあります。</p>



<p><span class="swl-marker mark_yellow">「<strong>配列名.length</strong>」とすると、その配列のデータ数が取得できます。</span></p>



<p>今回の場合は、<span class="swl-marker mark_orange">elementsという名前の配列のデータ数を取得し「Webページから取得された見出しが何個あるのか」判断しようとしています。</span></p>



<p>そして、</p>



<p class="has-border -border01">もし取得される見出しが30個より少なければ、処理Aを実行<br>その他の場合（取得される見出しが30個以上の場合）は処理Bを実行</p>



<p>と条件分岐するように設定したわけです。</p>



<h3 class="wp-block-heading" id="4行目-13行目-if文-処理a-for文">4行目-13行目 if文 処理A for文</h3>



<p><code>if (elements.length &lt; 30) {<br><br>    for (var element of elements) {<br>        result.push(element.innerText);<br>    }<br><br>}</code></p>



<p>コードから<strong>「取得される見出しが30個より少ない場合」</strong>で条件分岐した部分を切り出すと、以上のようになります。</p>



<p>中身は「<strong>for文</strong>」で書かれていますね。<br><code>for (var element of elements) {<br>   result.push(element.innerText);<br>}</code></p>



<p><span class="swl-marker mark_yellow">「elements」という配列の中から、データを「element」という変数として取り出し、その1つ1つに対して繰り返しをしています。</span></p>



<p><code>result.push(element.innerText);</code></p>



<p>ここでは、<strong>取り出した1つ1つの見出しのテキストを「result」という名前の配列に追加しています。</strong></p>



<p><span class="swl-marker mark_orange"><strong>「配列名.push(データ)</strong>」とすることで、その配列に( )内のデータを追加することができる</span>のです。</p>



<p>そして、「element.innerText」の箇所ですが、<span class="swl-marker mark_orange">「<strong>取り出した要素.innerText</strong>」とすることで、要素のテキストをデータとして設定できます</span>。</p>



<p>ただし、これは、<br>2行目のdocument.querySelectorAll(&#8220;h2&#8221;) で取った要素だからできることです。</p>



<p>詳しく説明するとかえって分かりにくくなってしまうので、今は<strong>「へー、そんなこともできるんだ〜」</strong>ぐらいに思っていただけると幸いです。</p>



<h3 class="wp-block-heading" id="4行目-13行目-if文-処理b">4行目-13行目 if文 処理B</h3>



<p><code>else {<br>    var message = "要素が多すぎます";<br>    result.push(message);<br>}</code></p>



<p>if文の<strong>「その他の場合（取得される見出しが30個以上の場合）」</strong>の処理を抜き出すと、このようになります。</p>



<p>この箇所は、これまでの内容で説明できますね。<br><code>var message = "要素が多すぎます";</code><br>で「message」という名前の変数に「”要素が多すぎます”」という文字列データを設定し、</p>



<p><code>result.push(message);</code><br>という箇所で、「result」配列に変数messageのデータを入れています。</p>



<h3 class="wp-block-heading" id="最後の部分">最後の部分</h3>



<p><code>// completionを呼び出して終了<br>completion(result);</code></p>



<p>1行目は、<strong>コメントアウト</strong>をしてコードの説明をしていますね。</p>



<p><code>completion(result);</code><br>これは、<span class="swl-marker mark_yellow">ショートカットでJavaScriptを実行して何を結果として出力するのかを決めています。</span></p>



<p>ショートカット作成時に「JavaScriptの結果」という変数がありましたね。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/14-2.jpeg" alt="" class="wp-image-3811" width="256" height="284" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/14-2.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/14-2-271x300.jpeg 271w" sizes="(max-width: 256px) 100vw, 256px" /></figure></div>



<p><span class="swl-marker mark_orange">completion( )の( )内に入れたデータが「<strong>JavaScriptの結果</strong>」になります。</span></p>



<p>ですので、<strong>completion(result)とすることで、「result」配列を「JavaScriptの結果」として出力するよう設定できた</strong>わけです。</p>



<p>ちなみに、<span class="swl-marker mark_yellow">ショートカットで「JavaScriptの結果」を利用しない場合も、「completion( )」というように() 内を空白にして、コードの最後に記述しなければならないので注意</span>です。</p>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5725212284208116"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5725212284208116"
     data-ad-slot="2014468485"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h3 class="wp-block-heading" id="補足-関数とメソッドについて">補足：関数とメソッドについて</h3>



<p>今回ショートカットで使ったコードの意味が理解できましたでしょうか？</p>



<p>ここで、軽く補足させてください。</p>



<p><strong>「配列名.push()」</strong></p>



<p><strong>「取得した要素.innerText」</strong></p>



<p>など、今回<strong>「〇〇.××」</strong>という形のものが多く出ました。</p>



<p>「何をしているのか、よくわからなかった&#8230;」<br>という方も多いはずです。</p>



<p><span class="swl-marker mark_orange">「.××」の部分は「<strong>メソッド</strong>」という言葉で説明できます。</span></p>



<p><span class="swl-marker mark_yellow"><strong>メソッド</strong>とは、「○○」の箇所の特定の形式（変数, 配列など）に紐づいた「<strong>関数</strong>」のことです</span>。</p>



<p><span class="swl-marker mark_yellow">「<strong>関数</strong>」とは</span>、簡単に言うと<span class="swl-marker mark_yellow">処理をひとまとめにしたもの</span>です。</p>



<p>例えば、</p>



<p><strong>・Aという配列を定義する<br>・Aのデータを全て大文字にする</strong></p>



<p>という処理を記述した複数行のコードを「upperA」という名前の「<strong>関数</strong>」として設定すれば、「upperA」と書くだけで簡単に以上の処理を行えるようになります。</p>



<p><span class="swl-marker mark_orange">JavaScriptには、事前に用意されている関数がたくさんあります。</span></p>



<p>そのうち、<span class="swl-marker mark_yellow">「〇〇.××」と言う形式で呼び出せる「××」（という<strong>関数</strong>）が「<strong>メソッド</strong>」というわけです。</span></p>



<p>メソッドや関数がどういったものが理解できたでしょうか？</p>



<p>今回は分かりやすさを重視した説明になっていますので、枝葉となるような情報は省いています。</p>



<p>とりあえず雰囲気を掴んでいただけたら幸いです。</p>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5725212284208116"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5725212284208116"
     data-ad-slot="2014468485"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h3 class="wp-block-heading" id="終わりに">終わりに</h3>



<figure class="wp-block-image size-full"><img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/uploads/2022/02/データ-23.jpg" alt="" class="wp-image-3814" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/データ-23.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-23-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-23-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>今回の記事では、</p>



<ul class="is-style-check_list wp-block-list"><li><strong>ショートカットでJavaScriptを書いて実行</strong></li><li><strong>メソッドと関数について説明</strong></li></ul>



<p>といったことをしました。</p>



<p>実践もしつつ、新しいこともたくさん学習しましたので、かなりボリューミーな内容だったと思います。</p>



<p>これで、【iOSショートカットで学ぶ！ショートカット教室】のJavaScript編は終了です。</p>



<p>本当にお疲れ様でした。</p>



<p><span class="swl-marker mark_yellow">ここまで読み進められた方は、JavaScriptの基礎部分は理解できていると言って良いでしょう。</span></p>



<p>もし、「<strong>もっと本気で学びたい！</strong>」という方が多数いれば、より詳細な解説記事を出すことも検討します！</p>



<p>次回から、【iOSショートカットで学ぶ！ショートカット教室】<strong>Web API編</strong>に突入します。</p>



<p>「Web API」を理解し、実際に使うところまで丁寧に解説していきます。</p>



<p>お楽しみに！</p>



<p>次回の記事は<a href="https://automa-recipe.com/learn-programming/webapi-dict/" title="Web APIって何？iPhoneショートカットで活用する方法！">こちら！</a></p>


<div class="swell-block-postLink" data-style="card">			<a href="https://automa-recipe.com/learn-programming/webapi-dict/" class="p-blogCard -internal" data-type="type3">
			<div class="p-blogCard__inner">
				<span class="p-blogCard__caption">あわせて読みたい</span>
				<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー-300x169.png" alt="" class="c-postThumb__img -no-lb"></figure></div>				<div class="p-blogCard__body">
					<span class="p-blogCard__title">Web APIって何？iPhoneショートカットで活用する方法！</span>
					<span class="p-blogCard__excerpt">みなさん、「Web API」って知っていますか？ 全く知らない、聞いたことがあるけど使ったことがない、という人が多いのではないでしょうか？ Web APIを使いこなすことが&#8230;</span>				</div>
			</div></a>
		</div>


<h4 class="wp-block-heading" id="プログラミング教室の記事一覧">プログラミング教室の記事一覧</h4>


<div class="p-postListWrap  "><ul class="p-postList -type-list"><li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/how-to-earn/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【経験談あり】プログラミングの基礎を理解した後、副業で稼ぐ３つの方法を解説！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-06">2022.02.06</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/difference-proggraming/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【超簡単】iPhoneの「ショートカット」アプリでプログラミング学習を始めよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-01-30">2022.01.30</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/three-factors/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">iPhoneショートカットの「スクリプティング」とは？プログラミングの基本3要素を理解しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-01">2022.02.01</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/what-is-variable/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【徹底解説！】「変数」って何？iPhoneショートカットを作りながらマスターしよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-03">2022.02.03</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/how-use-if/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【if文をマスターする！】iPhoneショートカットで条件分岐を完全理解しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-04">2022.02.04</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/how-repeat/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">「繰り返す」や「リスト」をiPhoneショートカットで使いこなそう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-05">2022.02.05</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/iphone-javascript/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">「JavaScript」とは？iPhoneショートカットで実行する方法を徹底解説！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-06">2022.02.06</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/javascript-variable-list/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">JavaScriptで「変数」と「配列」を扱う方法を学習しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-09">2022.02.09</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/javascript-if-for/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">「条件分岐」「繰り返し」をJavaScriptで行う方法を理解しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-11">2022.02.11</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/webapi-dict/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">Web APIって何？iPhoneショートカットで活用する方法！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-13">2022.02.13</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/shortcuts-webapi-practice/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">実践！iPhoneショートカットでWeb APIを使いこなそう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-19">2022.02.19</time>
		</div>
				</div>
			</div>
			</a>
</li>
</ul></div><p>The post <a href="https://automa-recipe.com/learn-programming/javascript-code-write/">JavaScriptの実践編！関数とメソッドについても解説！</a> first appeared on <a href="https://automa-recipe.com">オートクック！</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://automa-recipe.com/learn-programming/javascript-code-write/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>「条件分岐」「繰り返し」をJavaScriptで行う方法を理解しよう！</title>
		<link>https://automa-recipe.com/learn-programming/javascript-if-for/</link>
					<comments>https://automa-recipe.com/learn-programming/javascript-if-for/#respond</comments>
		
		<dc:creator><![CDATA[automa-recipe]]></dc:creator>
		<pubDate>Fri, 11 Feb 2022 00:49:47 +0000</pubDate>
				<category><![CDATA[プログラミング教室]]></category>
		<category><![CDATA[まとめ]]></category>
		<guid isPermaLink="false">https://automa-recipe.com/?p=3772</guid>

					<description><![CDATA[<p><img src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3.png" class="webfeedsFeaturedVisual" /></p><p>【iOSショートカットで学ぶ！プログラミング教室】の第8回となった今回は、 JavaScriptで「条件分岐」「繰り返し」を行う方法を学習していきます。 プログラミングの基本3要素は「順次」「条件分岐」「繰り返し」でした [&#8230;]</p>
<p>The post <a href="https://automa-recipe.com/learn-programming/javascript-if-for/">「条件分岐」「繰り返し」をJavaScriptで行う方法を理解しよう！</a> first appeared on <a href="https://automa-recipe.com">オートクック！</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><img src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3.png" class="webfeedsFeaturedVisual" /></p><p><a href="https://automa-recipe.com/programming_articles/" title="【iOSショートカットで学ぶ】プログラミング教室">【iOSショートカットで学ぶ！プログラミング教室】</a>の第8回となった今回は、</p>



<p>JavaScriptで<strong>「条件分岐」「繰り返し」</strong>を行う方法を学習していきます。</p>



<p><span class="swl-marker mark_orange">プログラミングの基本3要素は「順次」「条件分岐」「繰り返し」</span>でしたね。</p>



<p>もし、それぞれの意味を忘れてしまった方は、<a href="https://automa-recipe.com/learn-programming/three-factors/" title="iPhoneショートカットの「スクリプティング」とは？プログラミングの基本3要素を理解しよう！">第2回の記事</a>で復習してみてください！</p>


<div class="swell-block-postLink" data-style="card">			<a href="https://automa-recipe.com/learn-programming/three-factors/" class="p-blogCard -internal" data-type="type3">
			<div class="p-blogCard__inner">
				<span class="p-blogCard__caption">あわせて読みたい</span>
				<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー-300x169.jpg" alt="" class="c-postThumb__img -no-lb"></figure></div>				<div class="p-blogCard__body">
					<span class="p-blogCard__title">iPhoneショートカットの「スクリプティング」とは？プログラミングの基本3要素を理解しよう！</span>
					<span class="p-blogCard__excerpt">iOSショートカットを作成する時に、アクションの追加画面には「スクリプティング」項目が出てきますよね。ショートカットを作ったことがある方なら、一度は見たことがあ&#8230;</span>				</div>
			</div></a>
		</div>


<p>そして<a href="https://automa-recipe.com/learn-programming/how-use-if/" title="【if文をマスターする！】iPhoneショートカットで条件分岐を完全理解しよう！">第4回</a>、<a href="https://automa-recipe.com/learn-programming/how-repeat/" title="「繰り返す」や「リスト」をiPhoneショートカットで使いこなそう！">第5回</a>では、ショートカットで「条件分岐」「繰り返し」をショートカットで使いこなす方法を理解しました。</p>



<p><span class="swl-marker mark_yellow">すでに、皆さんはその本質を理解していると言って良いと思います。</span></p>



<p>今回はこれまでに習得してきた知識をフル活用して、<br><span class="swl-marker mark_orange">ショートカットとJavaScriptとで一致している点と異なっている点を意識しながら学習していきましょう！</span></p>



<p>きっと理解が深まっていくのを感じるはずです。</p>



<p>それでは、Let`s プログラミング！</p>



<div class="swell-toc-placeholder"></div>



<h2 class="wp-block-heading" id="javascriptで条件分岐をする方法">JavaScriptで条件分岐をする方法</h2>



<figure class="wp-block-image size-full"><img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/uploads/2022/02/データ-15.jpg" alt="" class="wp-image-3776" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/データ-15.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-15-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-15-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>まずは<strong>条件分岐</strong>から学習していきましょう。</p>



<p>ショートカットで条件分岐をするとき、何のアクションを使っていたか覚えていますか？</p>



<p><strong>「if文」</strong>でしたよね。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/1.jpeg" alt="" class="wp-image-3623" width="400" height="131" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/1.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/1-300x98.jpeg 300w" sizes="(max-width: 400px) 100vw, 400px" /></figure></div>



<p><span class="swl-marker mark_yellow">この「if文」はJavaScriptで条件分岐をする時も使います。</span></p>



<p>実はJavaScriptで条件分岐をする方法は「if文」以外にも多々あるのですが、最もよく使用されるのはif文です。</p>



<p>そのため、今回は「if文」に焦点を当てて解説していきます。</p>



<h3 class="wp-block-heading" id="if文の書き方">if文の書き方</h3>



<p>まずは、if文をJavaScriptでどのように書くのかを見てみましょう。</p>



<p><code>if (条件) {<br>  なんらかの処理      <br>}</code></p>



<p>上のように記述すると、「<strong>条件</strong>」が正しい時に<strong>{ }</strong>内に書かれた処理をおこなうように設定できます。</p>



<p><strong>「ショートカットだったら、”その他の場合”みたいなのなかった？」</strong><br>と思われた方もいると思います。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/2.jpeg" alt="" class="wp-image-3624" width="339" height="253" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/2.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/2-300x224.jpeg 300w" sizes="(max-width: 339px) 100vw, 339px" /></figure></div>







<p>「その他の場合」というのは設定した条件に合致しない時におこなうアクションを決めたい時に使いましたね。</p>



<p><span class="swl-marker mark_yellow">ショートカットで言う<strong>「その他の場合」</strong>は、JavaScriptで言うと<strong>「else」</strong>になります。</span></p>



<p>実際に見た方が分かりやすいと思いますので、以下のコードを見てみましょう。</p>



<p><code>if (条件式) {<br>   処理A<br>} else {<br>   処理B<br>}</code></p>



<p>ショートカットのif文の画像と見比べてみると、<strong>構造が一緒</strong>だということが分かるでしょう。</p>



<p>なんとなくJavaScriptでif文を使うイメージが掴めたのではないでしょうか？</p>



<h3 class="wp-block-heading" id="if文を複数使う">if文を複数使う</h3>



<p>ショートカットでは<strong>「ネスト」</strong>するなどして、<span class="swl-marker mark_orange">if文を複数使い条件分岐することができましたね。</span></p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/3.jpeg" alt="" class="wp-image-3626" width="301" height="377" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/3.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/3-239x300.jpeg 239w" sizes="(max-width: 301px) 100vw, 301px" /></figure></div>



<p>以上のようにショートカットでif文をネストさせた時は、</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/4.png" alt="" class="wp-image-3627" width="526" height="296" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/4.png 960w, https://automa-recipe.com/wp-content/uploads/2022/02/4-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/4-768x432.png 768w" sizes="(max-width: 526px) 100vw, 526px" /></figure></div>



<p>このようになります。</p>



<p>JavaScriptでも「ネスト」は可能です。</p>



<p>先ほどの状態を、JavaScriptで「ネスト」したif文で再現すると以下のようになります。</p>



<p><code>if (条件A) {     <br>    処理A<br>} else {<br>    if(条件B) {<br>        処理B<br>    } else {<br>        処理C<br>    }<br>}</code></p>



<p>※「アクション」を処理と言い換えています。</p>



<p>しかし、<strong>上のような記述は少し読みにくい</strong>ですよね。</p>



<p><span class="swl-marker mark_orange">実はJavaScriptのif文には、複数の条件を設定した時も読みやすくなるような書き方が用意されています。</span></p>



<p>先ほどの記述を分かりやすい書き方に直すと、以下のようになります。</p>



<p><code>if (条件A) {<br>    処理A<br>} else if (条件B) {<br>    処理B<br>} else {<br>    処理C<br>}</code></p>



<p>非常に分かりやすくなりました。</p>



<p><span class="swl-marker mark_yellow">ポイントは、<strong>「else if (条件B)」</strong>の箇所でしょう。</span></p>



<p><span class="swl-marker mark_orange">「else if」で、ショートカットで言う”その他の場合”に細かい条件をプラスできたイメージです。</span></p>



<p>このように記述によって、</p>



<p>条件Aに合致する<br>→処理Aを実行</p>



<p>条件Aに合致せず、条件Bに当てはまる<br>→処理Bを実行</p>



<p>条件Aに合致せず、条件Bにも当てはまらない<br>→処理Cを実行</p>



<p>という複雑な条件分岐が簡単に記述することができました。</p>



<h3 class="wp-block-heading" id="条件の設定方法">条件の設定方法</h3>



<p>JavaScriptのif文では、<strong>条件を( )内に記述</strong>します。</p>



<p><code>if (<strong>条件</strong>) {<br>  処理<br>}</code></p>



<p>条件部分にどんなことを書くかを具体例で見てみましょう。</p>



<p>var number = 10;</p>



<p><code>if (<strong>number &gt;= 5</strong>) {<br>    処理A<br>} else if (<strong>number == 2</strong>){<br>    処理B<br>} else {<br>    処理C<br>}</code></p>



<p>上のプログラムを解読すると、以下のようになります。</p>



<p class="has-border -border01">最初に「number」という変数（箱）に、10というデータを入れました。<br>そして、その「number」が5以上の時は、処理Aを実行します。<br>もし、「number」が5以上ではなく、2だった場合は処理Bを実行します。<br>もし、「number」が5以上ではなく、2でない場合は処理Cを実行します。</p>



<p>条件部分に<strong>「&gt;=」や「==」</strong>などの記号が使われていますよね。</p>



<p><span class="swl-marker mark_yellow">これを<strong>「比較演算子」</strong>と言います。</span></p>



<p>if文の条件の設定方法は様々ですが、「比較演算子」が最もよく使われます。</p>



<p><span class="swl-marker mark_orange">比較演算子を使うことで、左の値と比べて右の値が大きいのか、小さいのか、同じなのかを判断してくれます。</span></p>



<p>比較演算子の一覧と、使用例を図にしてみました。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/1-1-1024x728.png" alt="" class="wp-image-3775" width="554" height="393" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/1-1-1024x728.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/1-1-300x213.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/1-1-768x546.png 768w, https://automa-recipe.com/wp-content/uploads/2022/02/1-1.png 1240w" sizes="(max-width: 554px) 100vw, 554px" /></figure></div>







<p><span class="swl-marker mark_orange"><strong>注意すべきは最初の２つ</strong>です。</span></p>



<p>“10”というのは、文字列として認識されます。</p>



<p>“山田”や”鈴木”などと同じです。</p>



<p>しかし、中身の数字としては10ですよね。</p>



<p>これは、10と同じと言えるのか、違うのか。</p>



<p><span class="swl-marker mark_yellow">このように「文字としての数値」を判別するために、「==」「===」の2種類のイコールが用意されています。</span></p>



<p>「==」は”10”という文字列であっても中身の10という数字を見て判定してくれます。<br>なので、10 == &#8220;10&#8221; は条件として正しいと判断されます。</p>



<p>「===」では”10”という文字列は、あくまでも文字として扱われるので数字として認識されません。<br>それゆえ、10 === “10”は条件として誤りだと判断されるわけです。</p>



<p>比較演算子を使った条件設定の方法をだいたい理解できましたでしょうか？</p>



<p>これで、if文における条件設定の基礎はとりあえずOKです。</p>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5725212284208116"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5725212284208116"
     data-ad-slot="2014468485"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h2 class="wp-block-heading" id="javascriptで繰り返しをする方法">JavaScriptで繰り返しをする方法</h2>



<figure class="wp-block-image size-full"><img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/uploads/2022/02/データ-16.jpg" alt="" class="wp-image-3777" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/データ-16.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-16-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-16-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>条件分岐に続いて、<strong>JavaScriptで”繰り返し”をする方法</strong>について解説していきます。</p>



<p><span class="swl-marker mark_yellow">ショートカットでは、<strong>「繰り返し」「各項目を繰り返す</strong>」などのアクションを使って”繰り返し”を行い、<strong>「リスト」</strong>が”繰り返し”において重要な役割を果たしていました。</span></p>



<p><span class="swl-marker mark_orange">ショートカットの<strong>「繰り返し」「各項目を繰り返す」</strong>などのアクションは、<strong>JavaScriptの「for文」</strong>に対応します。</span></p>



<p>そして、前回でも説明したように<span class="swl-marker mark_orange">ショートカットの<strong>「リスト</strong>」は、<strong>JavaScriptの「配列」</strong>に相当します。</span></p>



<p>つまり、<strong>JavaScriptでは「for文」と「配列」を上手く使えれば、”繰り返し”をすることができる</strong>というわけです。</p>



<h3 class="wp-block-heading" id="シンプルな繰り返し">シンプルな繰り返し</h3>



<p>まずは、<strong>「決められた回数同じ処理をおこなう」</strong>方法を知りましょう。</p>



<p>ショートカットでいうと、「繰り返し」アクションを使うものですね。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/3-1.jpeg" alt="繰り返す 画像1" class="wp-image-3683" width="292" height="241" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/3-1.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/3-1-300x248.jpeg 300w" sizes="(max-width: 292px) 100vw, 292px" /></figure></div>







<p>JavaScriptでは「for文」を使って、以下のように記述します。</p>



<p><code>for (var number = 0; number &lt; 3; number++) {<br>    繰り返したい処理<br>}</code></p>



<p>最初は何をしているのかよく分からないと思います。</p>



<p>特に、 <strong>(<span class="swl-marker mark_blue">var number = 0</span>; <span class="swl-marker mark_green">number &lt; 3;</span> <span class="swl-marker mark_yellow">number++</span>) </strong>の部分ですね。</p>



<p><strong>for文の( )内には３つ設定すべき項目</strong>があります。</p>



<p><strong><span class="swl-marker mark_blue">「初期化式」</span><span class="swl-marker mark_green">「条件式」</span><span class="swl-marker mark_yellow">「増減式」</span></strong>です。</p>



<p><span class="swl-marker mark_blue"><strong>初期化式</strong>では、数字をデータとした変数を設定します。</span><br>上の例で言う、「var number = 0;」の部分です。</p>



<p><span class="swl-marker mark_green"><strong>条件式</strong>では、初期化式で設定した変数の数字がどういった状態になるまで繰り返すかを設定します。</span><br>上の例で言うと、「number &lt; 3」の箇所です。</p>



<p><span class="swl-marker mark_yellow"><strong>増減式</strong>では、for文の{ }内で繰り返したい処理が1回終わるごとに、初期化式で設定した変数の数字にどれほどの増減をもたらすか、ということを設定します。</span><br>上の例で言うと、「number++」の部分になります。</p>



<p><strong>number++というのは、変数numberの数字に1をプラスするという意味</strong>です。</p>



<p>「何だか、よく分からなくなってきた…」<br>と思っている方も多いと思います。</p>



<p><code>for (var number = 0; number &lt; 3; number++) {<br>    繰り返したい処理<br>}</code></p>



<p>ここで、こちらのプログラムを実行すると、どのような動きとなるか詳しく見てみましょう。</p>



<ol class="is-style-num_circle wp-block-list"><li>「number」という名前で中身のデータが0の変数が定義されます。</li><li>今、numberの値は0なので、条件式「number &lt; 3」を満たします。</li><li>繰り返したい処理を1回おこないます。</li><li>処理が終わったら増減式の通りにnumberの値に1を足します。</li><li>今、numberの値は1なので、条件式「number &lt; 3」を満たします。</li><li>繰り返したい処理をもう1回おこないます。</li><li>処理が終わったら増減式の通りにnumberの値に1を足します。</li><li>今、numberの値は2なので、条件式「number &lt; 3」を満たします。</li><li>繰り返したい処理をもう1回おこないます。</li><li>処理が終わったら増減式の通りにnumberの値に1を足します。</li><li>今、numberの値は3なので、条件式「number &lt; 3」を満たしません。</li><li>繰り返したい処理はせず、実行を停止します。</li></ol>



<p>大体イメージがついたでしょうか？</p>



<p><strong><span class="swl-marker mark_orange">for文の( )内に「初期化式」「条件式」「増減式」の3つを設定することで、{ }内の処理を繰り返す回数を決めることができる</span></strong>のです。</p>



<p>自分で1から初期化式や増減式を考えると大変ですが、</p>



<p>基本的に、</p>



<p class="has-border -border01">「初期化式」には、<strong>変数名 = 0</strong>;<br>「条件式」には、<strong>変数名 &lt; 繰り返したい回数 &#8211; 1</strong>;<br>「増減式」には、<strong>変数名++</strong></p>



<p>というように記述すれば、思い通りの回数を指定できます。</p>



<p>一見難しそうなfor文ですが、<br>このパターンに当てはめて作れば簡単に繰り返しをすることできます！</p>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5725212284208116"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5725212284208116"
     data-ad-slot="2014468485"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h3 class="wp-block-heading" id="配列を使った繰り返し">配列を使った繰り返し</h3>



<p><strong>「JavaScriptで繰り返しするのって難しいんだな…」</strong>と感じた方に<strong>朗報</strong>です。</p>



<p>実は初心者にとっては配列を使った繰り返し処理の方が、回数を指定する繰り返しよりも簡単に感じる場合が多いのです。</p>



<p>今回は、最初に書き方のパターンを紹介します。</p>



<p><code>for (var 変数名 of 配列名) {<br>    処理<br>}</code></p>



<p><strong>（var 変数名 of 配列名) </strong>という部分では、</p>



<p><span class="swl-marker mark_yellow">ある配列から1つ1つデータを取り出し、それを新しい変数に入れているイメージです。</span></p>



<p><span class="swl-marker mark_orange">ショートカットで「リスト」から「各項目を繰り返す」アクションを使い「Rpeat Item（繰り返し項目）」としてリストのデータ1つ1つを取り出しているのと同じです。</span></p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/11-1-594x1024.jpeg" alt="" class="wp-image-3693" width="245" height="422" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/11-1-594x1024.jpeg 594w, https://automa-recipe.com/wp-content/uploads/2022/02/11-1-174x300.jpeg 174w, https://automa-recipe.com/wp-content/uploads/2022/02/11-1.jpeg 719w" sizes="(max-width: 245px) 100vw, 245px" /></figure></div>







<p>ここで具体例を見てみましょう。</p>



<p><code>var nameList = [“山田”, “佐藤”, “鈴木”]<br><br>for (var name of nameList) {<br>    処理<br>}</code></p>



<p>最初に3つの名前が入っている「nameList」という配列を定義しています。</p>



<p>そこから<span class="swl-marker mark_orange">「for文」で、nameListの値の1つ1つを「name」という名前の変数に入れ、処理を繰り返しおこなっています。</span></p>



<p>1回目の処理では、nameに”山田”というデータが入り、<br>2回目の処理では、nameに”佐藤”というデータが入り、<br>3回目の処理では、nameに”鈴木”というデータが入る。</p>



<p>という流れです。</p>



<p>シンプルに回数を決めて繰り返しをおこなうよりも、はるかに簡単ですよね。</p>



<p>しかも、<span class="swl-marker mark_yellow">使う頻度でいうと配列を使った繰り返しの方が多い</span>です。</p>



<p>次回の実践編でも、配列を使った繰り返しを使っていきますので、今回の説明で理解できない部分があれば何度か復習しておいてください！</p>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5725212284208116"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5725212284208116"
     data-ad-slot="2014468485"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h3 class="wp-block-heading" id="終わりに">終わりに</h3>



<figure class="wp-block-image size-full"><img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/uploads/2022/02/データ-17.jpg" alt="" class="wp-image-3778" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/データ-17.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-17-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-17-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>今回の記事では、</p>



<p><strong><span class="swl-marker mark_yellow">JavaScriptで「条件分岐・繰り返し」をする方法</span></strong>を解説しました。</p>



<p>なかなかボリューミーな内容だったと思います。</p>



<p>次回の実践編では、<a href="https://automa-recipe.com/learn-programming/what-is-variable/" title="【徹底解説！】「変数」って何？iPhoneショートカットを作りながらマスターしよう！">前回の第6回</a>と今回の第7回の内容の総復習として、実際にJavaScriptのコードを書いてSafariで実行していきます！</p>



<p>JavaScript編のクライマックスとなりますので、どうぞお楽しみに！</p>



<p>次回の記事はこちら！</p>


<div class="swell-block-postLink" data-style="card">			<a href="https://automa-recipe.com/learn-programming/javascript-code-write/" class="p-blogCard -internal" data-type="type3">
			<div class="p-blogCard__inner">
				<span class="p-blogCard__caption">あわせて読みたい</span>
				<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピー-300x169.png" alt="" class="c-postThumb__img -no-lb"></figure></div>				<div class="p-blogCard__body">
					<span class="p-blogCard__title">JavaScriptの実践編！関数とメソッドについても解説！</span>
					<span class="p-blogCard__excerpt">【iOSショートカットで学ぶ！プログラミング教室】これまで3回に渡って解説してきたJavaScript編もいよいよクライマックスです！ 今回は、実際にJavaScriptでコードを書&#8230;</span>				</div>
			</div></a>
		</div>


<h4 class="wp-block-heading" id="プログラミング教室の記事一覧">プログラミング教室の記事一覧</h4>


<div class="p-postListWrap  "><ul class="p-postList -type-list"><li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/how-to-earn/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【経験談あり】プログラミングの基礎を理解した後、副業で稼ぐ３つの方法を解説！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-06">2022.02.06</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/difference-proggraming/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【超簡単】iPhoneの「ショートカット」アプリでプログラミング学習を始めよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-01-30">2022.01.30</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/three-factors/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">iPhoneショートカットの「スクリプティング」とは？プログラミングの基本3要素を理解しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-01">2022.02.01</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/what-is-variable/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【徹底解説！】「変数」って何？iPhoneショートカットを作りながらマスターしよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-03">2022.02.03</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/how-use-if/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【if文をマスターする！】iPhoneショートカットで条件分岐を完全理解しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-04">2022.02.04</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/how-repeat/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">「繰り返す」や「リスト」をiPhoneショートカットで使いこなそう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-05">2022.02.05</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/iphone-javascript/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">「JavaScript」とは？iPhoneショートカットで実行する方法を徹底解説！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-06">2022.02.06</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/javascript-variable-list/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">JavaScriptで「変数」と「配列」を扱う方法を学習しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-09">2022.02.09</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/javascript-if-for/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">「条件分岐」「繰り返し」をJavaScriptで行う方法を理解しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-11">2022.02.11</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/webapi-dict/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">Web APIって何？iPhoneショートカットで活用する方法！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-13">2022.02.13</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/shortcuts-webapi-practice/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">実践！iPhoneショートカットでWeb APIを使いこなそう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-19">2022.02.19</time>
		</div>
				</div>
			</div>
			</a>
</li>
</ul></div><p>The post <a href="https://automa-recipe.com/learn-programming/javascript-if-for/">「条件分岐」「繰り返し」をJavaScriptで行う方法を理解しよう！</a> first appeared on <a href="https://automa-recipe.com">オートクック！</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://automa-recipe.com/learn-programming/javascript-if-for/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>JavaScriptで「変数」と「配列」を扱う方法を学習しよう！</title>
		<link>https://automa-recipe.com/learn-programming/javascript-variable-list/</link>
					<comments>https://automa-recipe.com/learn-programming/javascript-variable-list/#comments</comments>
		
		<dc:creator><![CDATA[automa-recipe]]></dc:creator>
		<pubDate>Wed, 09 Feb 2022 05:02:36 +0000</pubDate>
				<category><![CDATA[プログラミング教室]]></category>
		<category><![CDATA[まとめ]]></category>
		<guid isPermaLink="false">https://automa-recipe.com/?p=3750</guid>

					<description><![CDATA[<p><img src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2.png" class="webfeedsFeaturedVisual" /></p><p>JavaScriptなどのプログラミング言語を0から学ぼうとすると、とても大変です。 知らない概念が多く、新しく覚えなければならないことが沢山あるからです。 しかし、【iOSショートカットで学ぶ！プログラミング教室】シリ [&#8230;]</p>
<p>The post <a href="https://automa-recipe.com/learn-programming/javascript-variable-list/">JavaScriptで「変数」と「配列」を扱う方法を学習しよう！</a> first appeared on <a href="https://automa-recipe.com">オートクック！</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><img src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2.png" class="webfeedsFeaturedVisual" /></p><p>JavaScriptなどのプログラミング言語を0から学ぼうとすると、とても大変です。</p>



<p>知らない概念が多く、新しく覚えなければならないことが沢山あるからです。</p>



<p>しかし、<span class="swl-marker mark_yellow"><a href="https://automa-recipe.com/programming_articles/" title="【iOSショートカットで学ぶ】プログラミング教室">【iOSショートカットで学ぶ！プログラミング教室】</a>シリーズで、プログラミングの基本を身につけた皆さんであれば、他の方よりもはるかにプログラミング言語の学習効率が良くなります。</span></p>



<p><strong>「これって、ショートカットのアレと同じか…」</strong><br>と対比できれば、0から新しいことを学ぶよりも理解しやすいからです。</p>



<p>これから<strong>3回</strong>にわたって、これまでの【iOSショートカットで学ぶ！プログラミング教室】の内容を元に、JavaScriptの<strong>”超基本”</strong>を学習していきます！</p>



<p><span class="swl-marker mark_orange">厳密性や正確性にはこだわりすぎず、プログラミング初学者の方が理解しやすいように解説していきたいと考えています。</span></p>



<p>最後の実践編では、JavaScriptのコードを自分で書くところまでやっていきます。</p>



<p>今回はその助走段階として</p>



<ul class="is-style-check_list wp-block-list"><li><strong>変数の設定と呼び出し方</strong></li><li><strong>配列の使い方</strong></li></ul>



<p>について学んでいきます！</p>



<p>今後の内容すべての土台となりますので、時間をかけてしっかりと理解していきましょう！</p>



<p>それでは、Let’s プログラミング！</p>



<div class="swell-toc-placeholder"></div>



<h2 class="wp-block-heading" id="変数の設定と呼び出し方">変数の設定と呼び出し方</h2>



<figure class="wp-block-image size-full"><img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/uploads/2022/02/データ-18.jpg" alt="" class="wp-image-3780" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/データ-18.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-18-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-18-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>まずは、<span class="swl-marker mark_yellow">JavaScriptで変数を設定する方法</span>を解説します。</p>



<p><strong>「変数ってなんだっけ？」</strong><br>と思われた方は<a href="https://automa-recipe.com/learn-programming/what-is-variable/" title="【徹底解説！】「変数」って何？iPhoneショートカットを作りながらマスターしよう！">第３回の記事</a>で詳しく解説していますので、復習しておきましょう。</p>


<div class="swell-block-postLink" data-style="card">			<a href="https://automa-recipe.com/learn-programming/what-is-variable/" class="p-blogCard -internal" data-type="type3">
			<div class="p-blogCard__inner">
				<span class="p-blogCard__caption">あわせて読みたい</span>
				<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー-300x169.jpg" alt="" class="c-postThumb__img -no-lb"></figure></div>				<div class="p-blogCard__body">
					<span class="p-blogCard__title">【徹底解説！】「変数」って何？iPhoneショートカットを作りながらマスターしよう！</span>
					<span class="p-blogCard__excerpt">iOSショートカットの作成において、「変数」は非常に重要です。 「変数」を制すものがショートカットを制す、と言っても過言ではないでしょう。 しかし、ショートカット&#8230;</span>				</div>
			</div></a>
		</div>


<p><span class="swl-marker mark_orange">「変数はデータを入れる箱」</span>でしたね。</p>



<p>ショートカットでは<strong>「変数を設定」アクションや「マジック変数」</strong>などを使って、変数を利用していました。</p>



<p>JavaScriptにおいても、変数は必要不可欠な要素になりますので、その設定方法は理解しておかなければなりません。</p>



<p>JavaScriptで変数を設定するには、以下のようなコードを書きます。</p>



<p><code>var name = “山田”;</code></p>



<p>このように記述することで、以下のような”箱”が用意されます。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/1.png" alt="" class="wp-image-3751" width="405" height="228" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/1.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/1-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/1-768x432.png 768w" sizes="(max-width: 405px) 100vw, 405px" /></figure></div>



<h3 class="wp-block-heading" id="宣言-var-とは">宣言（var）とは</h3>



<p>JavaScriptでは、変数を使うときに<strong>「宣言」</strong>をします。</p>



<p><span class="swl-marker mark_orange">「これは変数です！」と”宣言”する</span>わけです。</p>



<p>その宣言が「var」の部分です。</p>



<p><code><strong>var</strong> name = “山田”;</code></p>



<p>宣言の仕方は、「var」以外にも「let」や「const」などあり、宣言の仕方によって変数の性質が変わってきます。</p>



<p>ここでは一旦、「宣言＝var」とだけ覚えておきましょう。</p>



<h3 class="wp-block-heading" id="変数名とデータ">変数名とデータ</h3>



<p><code>var name = “山田”;</code><br>宣言が済んだら、「name」の箇所で変数名を決め、「= ”山田”」という箇所でデータを設定します。</p>



<p>変数名は自分の好きなように決められますので、nameでもNameでもnamaeでも、なんでも構いません。</p>



<p>ただ、<span class="swl-marker mark_orange">注意点としては、「大文字と小文字は区別される」ということです。</span></p>



<p>例えば、nameとNameは違う変数として認識されるということです。</p>



<p>そして、データには数字や文字列など様々なものを設定することができます。</p>



<p><code>var name = “山田”;</code></p>



<p>以上の例では、山田を「<strong>””</strong>」を囲っていますよね。</p>



<p>これは<strong>「『山田』は文字列です！」</strong>とコンピューターに認識させています。</p>



<p>つまり、<span class="swl-marker mark_yellow">変数のデータに文字列を設定したい場合は、「””」で囲ってあげる必要があるということです。</span></p>



<p>逆に数字などは「””」で囲う必要はありません。<br><code>var number = 1;</code></p>



<p>ここまでの情報を図にすると以下のようになります。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/2.png" alt="" class="wp-image-3752" width="376" height="212" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/2.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/2-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/2-768x432.png 768w" sizes="(max-width: 376px) 100vw, 376px" /></figure></div>



<p><strong>「なんか文末に変なのついてるけど、あれは何?」</strong><br>と気になった方もいると思います。</p>



<p>「;」はセミコロンと呼び、<strong>「これでこの文は終わりですよ！」</strong>とコンピューターに知らせるものになります。</p>



<p>「;」は必要な場合と不必要な場合があるのですが、<span class="swl-marker mark_orange">変数の設定する際にはとりあえず書いておけば間違いない</span>と考えておけば大丈夫です。</p>



<h3 class="wp-block-heading" id="変数の呼び出し方">変数の呼び出し方</h3>



<p>これで、変数を設定することができましたが、設定しただけでは意味がありません。</p>



<p><span class="swl-marker mark_orange">変数は呼び出して、中身のデータを加工したり表示したりしてこそ価値が生まれます。</span></p>



<p>「変数の呼び出し」と聞くと難しそうに感じるかもしれませんが、実はとても簡単です。</p>



<p>変数を呼び出すには、変数名を書くだけでOKです。</p>



<p>例えば、<br><code>var name = “山田”;</code><br>というように変数を設定したのであれば、<strong>「name」と書くだけで「山田」というデータを呼び出すことができる</strong>のです。</p>



<p>これでJavaScriptにおける変数の基本（超入門者向け）はOKです。</p>



<p>より詳しい内容は必要となった時に覚えていけば大丈夫です！</p>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5725212284208116"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5725212284208116"
     data-ad-slot="2014468485"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h2 class="wp-block-heading" id="配列-リスト">配列（リスト）</h2>



<figure class="wp-block-image size-full"><img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/uploads/2022/02/データ-19.jpg" alt="" class="wp-image-3782" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/データ-19.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-19-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-19-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>続いて、<strong>「配列」</strong>について解説していきます。</p>



<p><strong>変数は1つにつき1つのデータしか扱うことができないので、複数のデータを扱うために「配列」というものが用意されています。</strong></p>



<p>これは、<span class="swl-marker mark_orange">ショートカットで言う「リスト」だと考えてください。</span></p>



<p>「リスト」では、複数のデータを扱うことができましたね。<br>詳しい解説は<a href="https://automa-recipe.com/learn-programming/how-repeat/" title="「繰り返す」や「リスト」をiPhoneショートカットで使いこなそう！">第５回</a>でしていますので、忘れてしまった方は復習してみてください。</p>


<div class="swell-block-postLink" data-style="card">			<a href="https://automa-recipe.com/learn-programming/how-repeat/" class="p-blogCard -internal" data-type="type3">
			<div class="p-blogCard__inner">
				<span class="p-blogCard__caption">あわせて読みたい</span>
				<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-300x169.jpg" alt="" class="c-postThumb__img -no-lb"></figure></div>				<div class="p-blogCard__body">
					<span class="p-blogCard__title">「繰り返す」や「リスト」をiPhoneショートカットで使いこなそう！</span>
					<span class="p-blogCard__excerpt">「繰り返す」「リスト」といったアクションは、「便利そうだけど、使い方がよく分からない…」と思っている方が多いと思います。 しかし、実際には難しいことはなく、正&#8230;</span>				</div>
			</div></a>
		</div>


<h3 class="wp-block-heading" id="配列の設定方法">配列の設定方法</h3>



<p>では、JavaScriptの「配列」はどのように設定すれば良いのでしょうか？</p>



<p><strong>「複数のデータを扱うってことは、変数より難しい文を書くことになりそう…」</strong><br>と思うかもしれませんが、</p>



<p>実は、<span class="swl-marker mark_yellow">「配列」の設定方法は、ほとんど変数と同じ</span>です。<br>以下の図を見てください。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/3.png" alt="" class="wp-image-3753" width="424" height="239" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/3.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/3-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/3-768x432.png 768w" sizes="(max-width: 424px) 100vw, 424px" /></figure></div>



<p><strong>「var」で”宣言”し、名前をつけ、データを設定する。</strong></p>



<p>この流れは変数の設定方法と全く一緒ですよね！</p>



<p><span class="swl-marker mark_orange">変数の場合と違うのは、<strong>設定するデータの形</strong>です。</span></p>



<p><strong><span class="swl-marker mark_yellow">配列は、複数のデータを[ ]で囲みます。</span></strong></p>



<p>そして、<strong>[ ]</strong>内の<span class="swl-marker mark_yellow">値と値との間をカンマ「<strong>,</strong>」で区切ります。</span></p>



<p>以上の点を押さえておけば、配列の設定方法は大丈夫です。</p>



<p>一応、具体例を見て理解を深めておきましょう。</p>



<p><code>var nameList = [“山田”, “鈴木”, “佐藤”];</code><br><code>var number = [1, 2, 3, 4]</code></p>



<h3 class="wp-block-heading" id="配列の呼び出し方">配列の呼び出し方</h3>



<p>変数と同様に、配列も呼び出し方を知っておく必要があります。</p>



<p><span class="swl-marker mark_orange">変数は呼び出したい変数の名前を書くだけで中身のデータを取り出し加工したりすることができました</span>ね。</p>



<p>変数と同様にして、配列も呼び出したい配列の名前を書くと中身のデータを取り出すことができます。</p>



<p>しかし、配列は変数とは違って、複数のデータを持っています。</p>



<p><span class="swl-marker mark_yellow">配列のデータ全てに対して変更を加えたりするときは、配列の名前を書くだけで十分なのですが、配列の個々のデータを取り出したいときなどは呼び出し方を変えなければなりません。</span></p>



<p>と言ってもイメージが湧きづらいと思いますので、それぞれの具体例を紹介しておきます。</p>



<p>配列のデータ全てに対して変更を加える時の例は以下の通りです。<br>・<strong>配列のデータ&#8221;全てを&#8221;削除する。<br>・配列の中身の文字列を&#8221;全て&#8221;大文字にする。</strong></p>



<p>配列の個々のデータにを取り出し変更を加える時の例は以下の通りです。<br><strong>・配列の&#8221;2つ目のデータだけ&#8221;削除する。<br>・配列の&#8221;3つ目の文字列だけ&#8221;大文字にする。</strong></p>



<p>後者の配列の個々のデータを呼び出す方法は少々特殊なので、順を追って解説していきます。</p>



<p>まず、以下のような配列を用意したとします。<br><code>var nameList = [“山田”, “鈴木”, “佐藤”];</code></p>



<p>このnameListという配列から「山田」という文字列を取り出したい時は以下のように記述します。</p>



<p><code>nameList[0]</code></p>



<p>続いて、「鈴木」という文字列を取り出したい時は以下のように記述します。</p>



<p><code>nameList[1]</code></p>



<p>最後に、「佐藤」という文字列を取り出したい時は以下のように記述します。</p>



<p><code>nameList[2]</code></p>



<p>つまり、配列から個々のデータを取り出すには、<br><strong><span class="swl-marker mark_yellow">配列名[取り出すデータが○番目かを示す番号]</span></strong><br>というように記述すれば良いというわけです。</p>



<p>しかし、<br><strong>「いや、”山田”は1番目だし”佐藤”は2番目のデータなんだから、さっきの呼び出し方はおかしくない？」</strong><br>と思った方が多いはずです。</p>



<p>先ほど、nameListという配列の<strong>1番目のデータ</strong>である「山田」を取り出す時、<br><code>nameList<strong>[0]</strong></code><br>と記述しました。</p>



<p>実は、ややこしいことに<span class="swl-marker mark_orange"><strong>配列の番号は「0番目, 1番目, 2番目, …」と数えていく決まりがある</strong>のです。</span></p>



<p>配列の番号は、ショートカットの「繰り返し」の「Repeat Index」に相当するものですが、この数え方に違いがあるのです。<br>（「Repeat Index」は1番目、2番目…と数えます）</p>



<p><span class="swl-marker mark_yellow">プログラミング言語で番号を扱うときは、一般的に「1」からではなく「0」から数えます。</span></p>



<p>この数え方は慣れないうちは違和感があると思うので注意です。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/4-1.png" alt="" class="wp-image-3754" width="392" height="221" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/4-1.png 960w, https://automa-recipe.com/wp-content/uploads/2022/02/4-1-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/4-1-768x432.png 768w" sizes="(max-width: 392px) 100vw, 392px" /></figure></div>







<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5725212284208116"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5725212284208116"
     data-ad-slot="2014468485"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h2 class="wp-block-heading" id="終わりに">終わりに</h2>



<figure class="wp-block-image size-full"><img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/uploads/2022/02/データ-20.png" alt="" class="wp-image-3783" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/データ-20.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-20-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-20-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>今回は、JavaScriptにおける</p>



<ul class="is-style-check_list wp-block-list"><li><strong>変数の設定と呼び出し方</strong></li><li><strong>配列の使い方</strong></li></ul>



<p>について解説しました。</p>



<p>これまでの記事で既に触れた内容が多く理解しやすかったのではないでしょうか？</p>



<p>一方で、プログラミング言語を扱うことに抵抗を感じた方もいらっしゃると思います。</p>



<p><span class="swl-marker mark_orange">プログラミング言語を使ってコードを書くのは、<strong>「慣れ」</strong>が非常に重要な要素となるので、ぜひ自分で書いてみて理解を深めていただきたいです。</span></p>



<p>次回は、<strong>JavaScriptを使った「条件分岐」「繰り返し」の方法</strong>について解説していきます。</p>



<p><span class="swl-marker mark_yellow">こちらもショートカットと同じところ、違うところを明確にしながら説明していきます</span>ので、お楽しみに！</p>



<p>次回の記事は<a href="https://automa-recipe.com/learn-programming/javascript-if-for/" title="「条件分岐」「繰り返し」をJavaScriptで行う方法を理解しよう！">こちら！</a></p>


<div class="swell-block-postLink" data-style="card">			<a href="https://automa-recipe.com/learn-programming/javascript-if-for/" class="p-blogCard -internal" data-type="type3">
			<div class="p-blogCard__inner">
				<span class="p-blogCard__caption">あわせて読みたい</span>
				<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3-300x169.png" alt="" class="c-postThumb__img -no-lb"></figure></div>				<div class="p-blogCard__body">
					<span class="p-blogCard__title">「条件分岐」「繰り返し」をJavaScriptで行う方法を理解しよう！</span>
					<span class="p-blogCard__excerpt">【iOSショートカットで学ぶ！プログラミング教室】の第8回となった今回は、 JavaScriptで「条件分岐」「繰り返し」を行う方法を学習していきます。 プログラミングの基&#8230;</span>				</div>
			</div></a>
		</div>


<h4 class="wp-block-heading" id="プログラミング教室の記事一覧">プログラミング教室の記事一覧</h4>


<div class="p-postListWrap  "><ul class="p-postList -type-list"><li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/how-to-earn/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【経験談あり】プログラミングの基礎を理解した後、副業で稼ぐ３つの方法を解説！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-06">2022.02.06</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/difference-proggraming/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【超簡単】iPhoneの「ショートカット」アプリでプログラミング学習を始めよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-01-30">2022.01.30</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/three-factors/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">iPhoneショートカットの「スクリプティング」とは？プログラミングの基本3要素を理解しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-01">2022.02.01</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/what-is-variable/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【徹底解説！】「変数」って何？iPhoneショートカットを作りながらマスターしよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-03">2022.02.03</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/how-use-if/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【if文をマスターする！】iPhoneショートカットで条件分岐を完全理解しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-04">2022.02.04</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/how-repeat/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">「繰り返す」や「リスト」をiPhoneショートカットで使いこなそう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-05">2022.02.05</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/iphone-javascript/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">「JavaScript」とは？iPhoneショートカットで実行する方法を徹底解説！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-06">2022.02.06</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/javascript-variable-list/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">JavaScriptで「変数」と「配列」を扱う方法を学習しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-09">2022.02.09</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/javascript-if-for/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">「条件分岐」「繰り返し」をJavaScriptで行う方法を理解しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-11">2022.02.11</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/webapi-dict/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">Web APIって何？iPhoneショートカットで活用する方法！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-13">2022.02.13</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/shortcuts-webapi-practice/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">実践！iPhoneショートカットでWeb APIを使いこなそう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-19">2022.02.19</time>
		</div>
				</div>
			</div>
			</a>
</li>
</ul></div><p>The post <a href="https://automa-recipe.com/learn-programming/javascript-variable-list/">JavaScriptで「変数」と「配列」を扱う方法を学習しよう！</a> first appeared on <a href="https://automa-recipe.com">オートクック！</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://automa-recipe.com/learn-programming/javascript-variable-list/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>「JavaScript」とは？iPhoneショートカットで実行する方法を徹底解説！</title>
		<link>https://automa-recipe.com/learn-programming/iphone-javascript/</link>
					<comments>https://automa-recipe.com/learn-programming/iphone-javascript/#comments</comments>
		
		<dc:creator><![CDATA[automa-recipe]]></dc:creator>
		<pubDate>Sun, 06 Feb 2022 10:02:40 +0000</pubDate>
				<category><![CDATA[プログラミング教室]]></category>
		<category><![CDATA[まとめ]]></category>
		<guid isPermaLink="false">https://automa-recipe.com/?p=3727</guid>

					<description><![CDATA[<p><img src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1.png" class="webfeedsFeaturedVisual" /></p><p>iOSやMacで使えるショートカットアプリは、JavaScriptを実行できる。 そのようなことを聞いても 「なんとなく凄いのは分かるけど、イマイチ何ができるのか分からない…」 という方が多いと思います。 本記事では、  [&#8230;]</p>
<p>The post <a href="https://automa-recipe.com/learn-programming/iphone-javascript/">「JavaScript」とは？iPhoneショートカットで実行する方法を徹底解説！</a> first appeared on <a href="https://automa-recipe.com">オートクック！</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><img src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1.png" class="webfeedsFeaturedVisual" /></p><p>iOSやMacで使えるショートカットアプリは、JavaScriptを実行できる。</p>



<p>そのようなことを聞いても</p>



<p><strong>「なんとなく凄いのは分かるけど、イマイチ何ができるのか分からない…」</strong></p>



<p>という方が多いと思います。</p>



<p>本記事では、</p>



<ul class="is-style-check_list wp-block-list"><li>JavaScriptとは何か</li><li>ショートカットと「JavaScript」で出来ること</li></ul>



<p>などについて解説していきます！</p>



<p><span class="swl-marker mark_orange">最後には、実践編としてショートカットでJavaScriptを実行していきますので、お楽しみに！</span></p>



<p><strong><a href="https://automa-recipe.com/programming_articles/" title="【iOSショートカットで学ぶ】プログラミング教室">「iOSショートカットで学ぶ！プログラミング教室」</a></strong>全５回にわたる初級編が終わり、ついに上級編に突入します。</p>



<p><span class="swl-marker mark_yellow">ショートカット作りでプログラミングの基礎を身につけた皆さんであれば、「JavaScript」などのプログラミング言語も理解し使いこなすことができるハズです</span>。</p>



<p>さらなる高みを目指していきましょう。</p>



<p>それでは、Let’s プログラミング！</p>



<div class="swell-toc-placeholder"></div>



<h2 class="wp-block-heading" id="javascriptって何">JavaScriptって何？</h2>



<p>そもそもJavaScirptとは何かを解説していきます。</p>



<p><span class="swl-marker mark_yellow">JavaScirptはプログラミング言語の一つです。</span></p>



<p><strong>「プログラミング言語って何？」</strong><br>と思う方も多いでしょう。</p>



<p><span class="swl-marker mark_orange">プログラミング言語は、<strong>”コード”</strong>を書くために必要なもの</span>です。</p>



<p>“コード” とは皆さんが「プログラミング」と聞くと、まず最初に思いつくあの難しそうな文章のことです。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/1.jpg" alt="" class="wp-image-3729" width="371" height="208" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/1.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/1-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/1-768x432.jpg 768w" sizes="(max-width: 371px) 100vw, 371px" /></figure></div>







<p>ショートカットでプログラミングをするときは、”コード”と呼ばれる難しい文章を書く必要はありません。</p>



<p><span class="swl-marker mark_orange">ショートカットがノーコードと呼ばれるツールであるからです。</span></p>



<p>しかし、<strong>より機能の優れたショートカットを作ろうと思うと、”コード”を書いてショートカットで実行する必要があります。</strong></p>



<p>プログラミングと「ショートカット」アプリの関係や、ノーコードについての説明は<a href="https://automa-recipe.com/learn-programming/difference-proggraming/" title="【超簡単】iPhoneの「ショートカット」アプリでプログラミング学習を始めよう！">第1回の記事</a>で詳しく解説しているので、そちらをご覧ください。</p>


<div class="swell-block-postLink" data-style="card">			<a href="https://automa-recipe.com/learn-programming/difference-proggraming/" class="p-blogCard -internal" data-type="type3">
			<div class="p-blogCard__inner">
				<span class="p-blogCard__caption">あわせて読みたい</span>
				<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5-300x169.jpg" alt="" class="c-postThumb__img -no-lb"></figure></div>				<div class="p-blogCard__body">
					<span class="p-blogCard__title">【超簡単】iPhoneの「ショートカット」アプリでプログラミング学習を始めよう！</span>
					<span class="p-blogCard__excerpt">みなさん、iOSの「ショートカット」アプリ使ってますか？ iPhoneやiPadだけでなく、Macでもショートカットアプリが使えるようになり、自動化・効率化に大活躍ですね。 &#8230;</span>				</div>
			</div></a>
		</div>


<p><span class="swl-marker mark_orange">JavaScriptは数あるプログラミング言語の中でも世界的に人気</span>で様々な場面で使われています。</p>



<p>皆さんも意識的ではないにしろJavaScriptで作られたものに触れているはずです。</p>



<p>その汎用性の広さから、<span class="swl-marker mark_yellow">プログラミング初学者の方には最初にJavaScriptを学習することが勧められるケースが多い</span>です。</p>



<p>JavaScriptを学んでおけば、Webページの見た目を整えたり・アプリを開発したり・自動化ツールを開発することなど、様々なことが出来るようになるからです。</p>



<p>また、<strong><span class="swl-marker mark_orange">ショートカットアプリで実行できるプログラミング言語はJavaScriptだけ</span></strong>になっています。</p>



<p>あのAppleも他のプログラミング言語ではなくJavaScriptを選んでいるという点からも、<strong>将来性</strong>が予想できますよね。</p>



<p class="is-style-big_icon_point"><strong>・JavaScriptはプログラミング言語の一つ<br>・ショートカットで使えるプログラミング言語はJavaScriptだけ</strong><br><strong>・JavaScriptは機能面と将来性の点からプログラミング初学者にお勧め</strong></p>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5725212284208116"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5725212284208116"
     data-ad-slot="2014468485"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h2 class="wp-block-heading" id="ショートカットで-javascriptを実行-すると何ができる">ショートカットで「JavaScriptを実行」すると何ができる？</h2>



<p>JavaScriptには非常に多くの機能があります。</p>



<p><span class="swl-marker mark_yellow">特にショートカットと関連性が深いのは<strong>「Webページの操作」</strong>ができる機能です。</span></p>



<p>「Webページの操作」とは、スマホやパソコンのブラウザ（SafariやChromeなど）で表示しているWebページの要素を操作することです。</p>



<p><strong>「Webページの要素を操作？なんだか難しそう…」</strong>と思うかもしれませんが、そんなことはありません。</p>



<p>なぜなら、皆さんがいつもブラウザ上でやっていることだからです。</p>



<p>例えば、</p>



<p class="has-border -border01">・あるボタンをクリックする<br>・ページのタイトルをコピーする<br>・フォームの内容を入力する<br>・ページをスクロールする</p>



<p>といったことです。</p>



<p>これらの操作をJavaScriptで実行することができるので<br>ショートカットでJavaScriptを実行すると、</p>



<p class="has-border -border01">・SNSの「いいね」ボタンをクリック<br>・ニュースサイトのタイトルを抜き出す<br>・いつも使うアプリのフォームに自動入力する<br>・読書する際、自動で速さを調節してくれる</p>



<p>といったことが可能になるのです。</p>



<p><span class="swl-marker mark_yellow"><strong>もともとのショートカットの機能と組み合わせれば、より便利なツールを作れること間違いなし</strong>です。</span></p>



<p>夢が広がりますね。</p>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5725212284208116"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5725212284208116"
     data-ad-slot="2014468485"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h2 class="wp-block-heading" id="実践編-ショートカットで実行してみよう">【実践編】ショートカットで実行してみよう！</h2>



<p>では、実際にショートカットでJavaScriptを実行してみましょう！</p>



<h3 class="wp-block-heading" id="事前準備">事前準備</h3>



<p>① 「設定」アプリを開いて、「ショートカット」を選択します。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/2-3-594x1024.jpeg" alt="" class="wp-image-3730" width="265" height="457" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/2-3-594x1024.jpeg 594w, https://automa-recipe.com/wp-content/uploads/2022/02/2-3-174x300.jpeg 174w, https://automa-recipe.com/wp-content/uploads/2022/02/2-3.jpeg 719w" sizes="(max-width: 265px) 100vw, 265px" /></figure></div>







<p>②「詳細」をタップします。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/3-2-663x1024.jpeg" alt="" class="wp-image-3731" width="261" height="403" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/3-2-663x1024.jpeg 663w, https://automa-recipe.com/wp-content/uploads/2022/02/3-2-194x300.jpeg 194w, https://automa-recipe.com/wp-content/uploads/2022/02/3-2.jpeg 750w" sizes="(max-width: 261px) 100vw, 261px" /></figure></div>







<p>③ 「スクリプトの実行を許可」をオンにします。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/4-2.jpeg" alt="" class="wp-image-3733" width="250" height="302" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/4-2.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/4-2-249x300.jpeg 249w" sizes="(max-width: 250px) 100vw, 250px" /></figure></div>



<p>これで事前準備は終了です！</p>



<p>続いて、実行するショートカットを作成していきましょう！</p>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5725212284208116"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5725212284208116"
     data-ad-slot="2014468485"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h3 class="wp-block-heading" id="ショートカットの作成">ショートカットの作成</h3>



<p>① 新規ショートカットの作成画面を開き、検索窓に「JavaScript」と入力し、「WebページでJavaScriptを実行」アクションを追加します。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/5-2.jpeg" alt="" class="wp-image-3734" width="251" height="229" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/5-2.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/5-2-300x274.jpeg 300w" sizes="(max-width: 251px) 100vw, 251px" /></figure></div>



<p><br>② 「”Webページ”に対してJavaScriptを実行」の”Webページ”をタップし、「ショートカットの入力」を選択します。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/6-2-600x1024.jpeg" alt="" class="wp-image-3735" width="251" height="429" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/6-2-600x1024.jpeg 600w, https://automa-recipe.com/wp-content/uploads/2022/02/6-2-176x300.jpeg 176w, https://automa-recipe.com/wp-content/uploads/2022/02/6-2.jpeg 727w" sizes="(max-width: 251px) 100vw, 251px" /></figure></div>







<p>③ 「“指定なし”から”任意”の入力を受け取る」の”指定なし”をタップし、「共有シートに表示」をオンにします。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/7-4-604x1024.jpeg" alt="" class="wp-image-3737" width="248" height="421" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/7-4-604x1024.jpeg 604w, https://automa-recipe.com/wp-content/uploads/2022/02/7-4-177x300.jpeg 177w, https://automa-recipe.com/wp-content/uploads/2022/02/7-4.jpeg 732w" sizes="(max-width: 248px) 100vw, 248px" /></figure></div>







<p>④ 続いて、検索窓に「クイックルック」と入力し、アクションを追加します。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/8-2.jpeg" alt="" class="wp-image-3738" width="242" height="168" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/8-2.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/8-2-300x208.jpeg 300w" sizes="(max-width: 242px) 100vw, 242px" /></figure></div>







<p>⑤ 「クイックルックアクション」が「”JavaScriptの結果”を QuickLookで表示」となっているのを確認したら、任意の名前をつけて完了。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/9-2-600x1024.jpeg" alt="" class="wp-image-3739" width="241" height="412" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/9-2-600x1024.jpeg 600w, https://automa-recipe.com/wp-content/uploads/2022/02/9-2-176x300.jpeg 176w, https://automa-recipe.com/wp-content/uploads/2022/02/9-2.jpeg 726w" sizes="(max-width: 241px) 100vw, 241px" /></figure></div>



<p>これでショートカットの作成が完了しました！</p>



<p>いざ、実行してみましょう！</p>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5725212284208116"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5725212284208116"
     data-ad-slot="2014468485"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h3 class="wp-block-heading" id="ショートカットを実行してみよう">ショートカットを実行してみよう！</h3>



<p>① 好きなWebサイトを”Safariで”開き、「共有」ボタンをタップします。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/10-3-594x1024.jpeg" alt="" class="wp-image-3740" width="236" height="407" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/10-3-594x1024.jpeg 594w, https://automa-recipe.com/wp-content/uploads/2022/02/10-3-174x300.jpeg 174w, https://automa-recipe.com/wp-content/uploads/2022/02/10-3.jpeg 719w" sizes="(max-width: 236px) 100vw, 236px" /></figure></div>







<p>② 共有画面をしたスクロールして、先ほど作ったショートカットをタップします。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/11-2-593x1024.jpeg" alt="" class="wp-image-3741" width="238" height="411" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/11-2-593x1024.jpeg 593w, https://automa-recipe.com/wp-content/uploads/2022/02/11-2-174x300.jpeg 174w, https://automa-recipe.com/wp-content/uploads/2022/02/11-2.jpeg 718w" sizes="(max-width: 238px) 100vw, 238px" /></figure></div>







<p>③ アクセス許可画面がでるので、「許可」をタップします。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/12-1-597x1024.jpeg" alt="" class="wp-image-3742" width="237" height="407" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/12-1-597x1024.jpeg 597w, https://automa-recipe.com/wp-content/uploads/2022/02/12-1-175x300.jpeg 175w, https://automa-recipe.com/wp-content/uploads/2022/02/12-1.jpeg 723w" sizes="(max-width: 237px) 100vw, 237px" /></figure></div>







<p>④ 開いているサイトに貼ってある全てのURLとURL先のタイトルが表示されれば成功です！</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/IMG_81C89A4778CC-1-2-601x1024.jpeg" alt="" class="wp-image-3743" width="243" height="414" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/IMG_81C89A4778CC-1-2-601x1024.jpeg 601w, https://automa-recipe.com/wp-content/uploads/2022/02/IMG_81C89A4778CC-1-2-176x300.jpeg 176w, https://automa-recipe.com/wp-content/uploads/2022/02/IMG_81C89A4778CC-1-2.jpeg 728w" sizes="(max-width: 243px) 100vw, 243px" /></figure></div>







<p>今回は、「WebページでJavaScriptを実行」アクションにデフォルトで設定されているものを使って実行してみました！</p>



<p><span class="swl-marker mark_orange"><strong>中身に書いてあるコードは今の段階では意味不明だとは思いますが、まずは実行できるようになることが重要</strong>です。</span></p>



<p>次回以降で<strong>「JavaScriptの基本」</strong>について解説していきます。</p>



<p><span class="swl-marker mark_yellow">最終的には、簡単なコードは理解できるようになると思います。</span>どうぞお楽しみに！</p>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5725212284208116"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5725212284208116"
     data-ad-slot="2014468485"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h2 class="wp-block-heading" id="終わりに">終わりに</h2>



<p><strong>「iOSショートカットで学ぶ！プログラミング教室」</strong>上級編の初回となった本記事では、</p>



<ul class="is-style-check_list wp-block-list"><li><strong>JavaScriptとは何か</strong></li><li><strong>ショートカットと「JavaScript」で出来ること</strong></li></ul>



<p>などについて解説しました！</p>



<p><span class="swl-marker mark_yellow">プログラミング言語を使えるようになった瞬間、見える世界が一気に広がっていくのを感じていただけたと思います。</span></p>



<p><strong>「あんなこともできるし….こんなこともできるかも…」</strong><br>と妄想を膨らませながら、次回に準備して欲しいです！</p>



<p>次回の記事は<a href="https://automa-recipe.com/learn-programming/javascript-variable-list/" title="JavaScriptで「変数」と「配列」を扱う方法を学習しよう！">こちら！</a></p>


<div class="swell-block-postLink" data-style="card">			<a href="https://automa-recipe.com/learn-programming/javascript-variable-list/" class="p-blogCard -internal" data-type="type3">
			<div class="p-blogCard__inner">
				<span class="p-blogCard__caption">あわせて読みたい</span>
				<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2-300x169.png" alt="" class="c-postThumb__img -no-lb"></figure></div>				<div class="p-blogCard__body">
					<span class="p-blogCard__title">JavaScriptで「変数」と「配列」を扱う方法を学習しよう！</span>
					<span class="p-blogCard__excerpt">JavaScriptなどのプログラミング言語を0から学ぼうとすると、とても大変です。 知らない概念が多く、新しく覚えなければならないことが沢山あるからです。 しかし、【iO&#8230;</span>				</div>
			</div></a>
		</div>


<h4 class="wp-block-heading" id="プログラミング教室の記事一覧">プログラミング教室の記事一覧</h4>


<div class="p-postListWrap  "><ul class="p-postList -type-list"><li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/how-to-earn/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【経験談あり】プログラミングの基礎を理解した後、副業で稼ぐ３つの方法を解説！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-06">2022.02.06</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/difference-proggraming/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【超簡単】iPhoneの「ショートカット」アプリでプログラミング学習を始めよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-01-30">2022.01.30</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/three-factors/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">iPhoneショートカットの「スクリプティング」とは？プログラミングの基本3要素を理解しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-01">2022.02.01</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/what-is-variable/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【徹底解説！】「変数」って何？iPhoneショートカットを作りながらマスターしよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-03">2022.02.03</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/how-use-if/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【if文をマスターする！】iPhoneショートカットで条件分岐を完全理解しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-04">2022.02.04</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/how-repeat/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">「繰り返す」や「リスト」をiPhoneショートカットで使いこなそう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-05">2022.02.05</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/iphone-javascript/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">「JavaScript」とは？iPhoneショートカットで実行する方法を徹底解説！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-06">2022.02.06</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/javascript-variable-list/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">JavaScriptで「変数」と「配列」を扱う方法を学習しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-09">2022.02.09</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/javascript-if-for/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">「条件分岐」「繰り返し」をJavaScriptで行う方法を理解しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-11">2022.02.11</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/webapi-dict/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">Web APIって何？iPhoneショートカットで活用する方法！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-13">2022.02.13</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/shortcuts-webapi-practice/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">実践！iPhoneショートカットでWeb APIを使いこなそう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-19">2022.02.19</time>
		</div>
				</div>
			</div>
			</a>
</li>
</ul></div><p>The post <a href="https://automa-recipe.com/learn-programming/iphone-javascript/">「JavaScript」とは？iPhoneショートカットで実行する方法を徹底解説！</a> first appeared on <a href="https://automa-recipe.com">オートクック！</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://automa-recipe.com/learn-programming/iphone-javascript/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>【経験談あり】プログラミングの基礎を理解した後、副業で稼ぐ３つの方法を解説！</title>
		<link>https://automa-recipe.com/learn-programming/how-to-earn/</link>
					<comments>https://automa-recipe.com/learn-programming/how-to-earn/#respond</comments>
		
		<dc:creator><![CDATA[automa-recipe]]></dc:creator>
		<pubDate>Sun, 06 Feb 2022 00:39:29 +0000</pubDate>
				<category><![CDATA[プログラミング教室]]></category>
		<category><![CDATA[まとめ]]></category>
		<guid isPermaLink="false">https://automa-recipe.com/?p=3527</guid>

					<description><![CDATA[<p><img src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー.jpg" class="webfeedsFeaturedVisual" /></p><p>これまで、iPhoneショートカットを通じてプログラミングの基礎を学習してきました。 「プログラミングって思ったより簡単で面白い！」と感じていただいた方も多いのではないでしょうか？ なかには、プログラミングの基礎を学び「 [&#8230;]</p>
<p>The post <a href="https://automa-recipe.com/learn-programming/how-to-earn/">【経験談あり】プログラミングの基礎を理解した後、副業で稼ぐ３つの方法を解説！</a> first appeared on <a href="https://automa-recipe.com">オートクック！</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><img src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー.jpg" class="webfeedsFeaturedVisual" /></p><p>これまで、iPhoneショートカットを通じてプログラミングの基礎を学習してきました。</p>



<p><strong>「プログラミングって思ったより簡単で面白い！」</strong>と感じていただいた方も多いのではないでしょうか？</p>



<p>なかには、プログラミングの基礎を学び<strong>「これが少しでも仕事になれば嬉しいな&#8230;」</strong>と思っている人もいると思います。</p>



<p>ただ厳しいことを言うと、<span class="swl-marker mark_orange">プログラミングの副業で仕事をしていくのは、基礎を理解したばかりの今の段階では難しい</span>です。</p>



<p>しかし、方法がないわけではありません。</p>



<p>今回は、<strong>プログラミングの基礎を理解したあと、副業で仕事を受ける３つの方法</strong>をご紹介します！</p>



<p><span class="swl-marker mark_yellow">プログラミング副業で稼げるようになった私自身の経験談も混ぜながら解説</span>していきますので、ぜひ最後までご覧ください！</p>



<div class="swell-toc-placeholder"></div>



<h3 class="wp-block-heading" id="副業で稼ぐ方法その1-とりあえずココナラで出品してみる">副業で稼ぐ方法その1： とりあえずココナラで出品してみる</h3>



<figure class="wp-block-image size-full"><img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-1.jpg" alt="" class="wp-image-3538" srcset="https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-1.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-1-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-1-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>おすすめの方法の一つ目は、<strong><a href="https://px.a8.net/svt/ejp?a8mat=3HQS19+DRCO36+2PEO+1HONMA">ココナラ</a>でとりあえずサービスを出品してみること</strong>です。<br>サービスとは例えば以下のようなものです。</p>



<figure class="wp-block-image size-full"><img decoding="async" width="786" height="197" src="https://automa-recipe.com/wp-content/uploads/2022/01/スクリーンショット-2022-01-29-14.07.02.png" alt="" class="wp-image-3528" srcset="https://automa-recipe.com/wp-content/uploads/2022/01/スクリーンショット-2022-01-29-14.07.02.png 786w, https://automa-recipe.com/wp-content/uploads/2022/01/スクリーンショット-2022-01-29-14.07.02-300x75.png 300w, https://automa-recipe.com/wp-content/uploads/2022/01/スクリーンショット-2022-01-29-14.07.02-768x192.png 768w" sizes="(max-width: 786px) 100vw, 786px" /></figure>



<p>今の段階でそんなことできるの？<br>と不安になるかもしれませんが安心してください。</p>



<p><a href="https://px.a8.net/svt/ejp?a8mat=3HQS19+DRCO36+2PEO+1HONMA">ココナラ</a>にはプログラミングのカテゴリの中に<strong>「作業自動化・効率化」</strong>という項目があります。</p>



<p>プログラミングの基礎を理解し、自分の好きなiPhoneショートカットを作れるようになった皆さんであれば、この「作業自動化・効率化」の分野でサービスを提供することが可能でしょう。</p>



<p>現状、GAS（Google Apps Script）やExcelマクロなどのサービスが多いですが、それらの<strong>”iPhoneショートカット版”</strong>を作れば一定のニーズはあるかなと思います。</p>



<p>とりあえず、<strong><span class="swl-marker mark_yellow"><a href="https://px.a8.net/svt/ejp?a8mat=3HQS19+DRCO36+2PEO+1HONMA">ココナラ</a>にはどんなサービスがあるのか検索してみるのがオススメ</span></strong>です。<br>特に「作業自動化・効率化」の箇所を重点的にチェックしてみてください！</p>



<h4 class="wp-block-heading" id="この方法のデメリット">この方法のデメリット</h4>



<p>一方で、この方法には１つデメリットがあります。</p>



<p>それは、<strong>最初の案件を受注する難易度が高い</strong>ことです。</p>



<p>ココナラにはサービスの評価制度があるので、良いサービスを提供している人には良い評価がついていき、そのような人に案件が集中します。</p>



<p>つまり、<span class="swl-marker mark_orange">新規で参入し評価が0の状態で戦っていくには難易度が高い</span>のです。</p>



<p>ただ、ショートカットという競合の少ないサービスで戦えば勝算はあります。もし、そのジャンルで１位になれれば一気に案件を獲得できるようになるからです。</p>



<h3 class="wp-block-heading" id="副業で稼ぐ方法その2-gasを勉強する">副業で稼ぐ方法その2：GASを勉強する</h3>



<figure class="wp-block-image size-full"><img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-2.jpg" alt="" class="wp-image-3539" srcset="https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-2.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-2-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-2-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>プログラミングの基礎を理解したあと副業で稼ぐための２つ目の方法は、<strong>GASを勉強すること</strong>です。</p>



<p>GASはGoogle Apps Scriptの略で、Googleが提供する自動化ツールです。</p>



<p>GASでは、１からプログラミングせずとも数行のコードを書くだけで簡単にアプリやツールが作れます。<br><strong>特にスプレッドシートの転機作業や、Gmailの自動転送などGooleアプリの自動化が得意なので、GASができる人のニーズはかなり多い</strong>です。</p>



<p>そして、GASは<strong>「JavaScript」</strong>というプログラミング言語で記述できます。<br>i<span class="swl-marker mark_yellow">PhoneショートカットにはJavaScriptを実行できるアクションがありますので、GASを学べば自然と作成できるショートカットの幅も広がります。</span></p>



<p><a href="https://px.a8.net/svt/ejp?a8mat=3HQS19+DRCO36+2PEO+1HONMA">ココナラ</a>でもサービスの出品が多く、それを求める人の数も多いので<strong>案件を獲得できる可能性は高い</strong>です。</p>



<p>実際、<span class="swl-marker mark_green">私もココナラで実際に評価０の状態からGASの案件を受注し、そこから業務委託で仕事を継続的にいただいていました。</span><br><strong>かなり再現性が高い</strong>方法だと思います。</p>



<p>勉強方法は、以下のサイトの内容を一通りこなし、自分の作りたいものを作ればOKです。<br><a href="https://tonari-it.com/google-apps-script-manual/">【保存版】初心者向け実務で使えるGoogle Apps Script完全マニュアル</a></p>



<p><br>３ヶ月もあれば案件を受注できるレベルになるでしょう。</p>



<h4 class="wp-block-heading" id="この方法のデメリット-1">この方法のデメリット</h4>



<p>こちらの方法では<strong>「案件の単価が低くなってしまう」</strong>ことがデメリットとして挙げられます。</p>



<p>ココナラの自動化分野では価格競争が起こっているので、特に始めたての時は<strong>「既に評価が高く価格が低い出品者に勝つために、自分のサービスの価格をさらに下げる」</strong>というようなことをしなければならない場合があります。</p>



<p><br>実体験として、私は一番最初は<a href="https://px.a8.net/svt/ejp?a8mat=3HQS19+DRCO36+2PEO+1HONMA">ココナラ</a>でGAS案件を2000円で受注しました。時給で言うと300円ほどになり、かなり悲しい思いをしました。</p>



<p>しかし、<strong><span class="swl-marker mark_yellow">ココナラで案件受注→直契約できた時に単価が一気に上がり、3万円のツールを1日で納品するコスパの良い案件も受けられるように</span></strong>なりました。直契約の誘いがあるまでは辛抱する必要があるのが難点です。</p>



<h3 class="wp-block-heading" id="副業で稼ぐ方法その3-スクールで実力をつける">副業で稼ぐ方法その3：スクールで実力をつける</h3>



<figure class="wp-block-image size-full"><img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-3.jpg" alt="" class="wp-image-3540" srcset="https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-3.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-3-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-3-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p><span class="swl-marker mark_orange">案件の単価を上げたり受注数を増やそうとすると、自然と求められるスキルは高くなります。</span></p>



<p>単価の高い案件とは、<br><strong>・Webサービス開発</strong><br><strong>・スマホアプリ開発<br>・業務システム開発</strong><br>などです。</p>



<p><strong>プログラミングのことを全く知らない初心者が、これらの案件を獲得し納品できるほどの実力を手に入れるのはそう簡単ではありません。</strong></p>



<p>たとえ、プログラミングスクールに通ったとしても、長期間通わなければならず費用がかかったり、なんとなくプログラミングの基礎を理解して終了してしまう可能性が高いです。</p>



<p><strong>しかし、皆さんは既にプログラミングの基礎を理解しています。</strong><br><span class="swl-marker mark_yellow">そういった人こそ、スクールに通う価値があります。</span></p>



<p>理由は２つあります。</p>



<h4 class="wp-block-heading" id="理由1-基礎的なカリキュラムは短期間で終わらせることができ-メンター付きの-実践-に時間を費やせる">理由1：基礎的なカリキュラムは短期間で終わらせることができ、メンター付きの”実践”に時間を費やせる</h4>



<p>私は、プログラミングの基礎を理解したのち、単価を上げるためオンラインのプログラミングスクールにいくことを決断しました。独学での限界を感じていたからです。</p>



<p>当時、<span class="swl-marker mark_yellow">既にプログラミングの基礎は理解していたので、<strong>基本的なカリキュラムを速攻で終わらせて基礎を再度固め直し、Webアプリケーションをメンターさんに質問しながら開発する実践に時間を費やせました</strong></span>。<br>そのおかげもあって、自分でアプリを開発できるようになり高単価の案件を獲得できるようになりました。</p>



<h4 class="wp-block-heading" id="理由2-コストを抑えることができる">理由2：コストを抑えることができる</h4>



<p>ただ、振り返ると失敗がありました。</p>



<p>それは、<strong><span class="swl-marker mark_orange">買い切り型のスクールを選んでしまったこと</span></strong>です。</p>



<p>私が通っていたスクールは、2ヶ月で20万円と非常に高額でした。</p>



<p>しかし、<span class="swl-marker mark_yellow">最初の1ヶ月でカリキュラムは全部終わってしまい、残りの1ヶ月は自分で開発をしつつ、週に1度メンターさんに1時間のビデオ会議で質問するだけでした。</span>特に質問がない週は、ただ1時間雑談をして終わりました。</p>



<p>非常に勿体無いことです。</p>



<p>この私の失敗から、みなさんには、<br><strong><span class="swl-marker mark_green">サブスクリプション型のプログラミングスクールをオススメしたい</span></strong>です。</p>



<p>つまり月額でお金を支払う方式で、不要になったらいつでも解約できるスクールです。</p>



<p>プログラミングの基礎を理解している皆さんであれば、<strong>カリキュラムを通常の方よりも早く終わらせることができ、</strong><br>結果的に<strong>買い切り型のスクールよりも、はるかに安い価格でスクールに通うことができる</strong>わけです。</p>



<p>そして、選ぶスクールの条件に<strong>「無料体験や説明会がある」</strong>というのも重要です。</p>



<p>・そのスクールを卒業した先に手にいられるものは何か？<br>・メンターの人は面倒見の良い人か？<br>・顧客対応の早さはどうか？<br>など、<span class="swl-marker mark_orange"><strong>スクールの無料体験や説明会を受講して検討してから、通うスクールを決断するのが良い</strong></span>でしょう。</p>



<h3 class="wp-block-heading" id="プログラミングスクール-多すぎ問題">プログラミングスクール、多すぎ問題</h3>



<figure class="wp-block-image size-full"><img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-4.jpg" alt="" class="wp-image-3541" srcset="https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-4.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-4-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-4-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>『サブスク型&amp;無料体験or説明会があるスクール』</p>



<p>これだけ条件を絞っても<br><strong>「スクールが多すぎて選べない！」</strong>という方も多いと思います。</p>



<p>実際、当時の私もプログラミングスクールを検索してその数に驚きました。<br><span class="swl-marker mark_orange">こんなに膨大な数のスクールの中から、自分に合ったスクールを見つけ出すのは至難の技</span>かもしれません。</p>



<p>しかし、ここで朗報なのですが、こんなサービスを見つけました。</p>


<div class="p-adBox -normal -border-off" data-id="3674" data-ad="normal"><div class="p-adBox__body"><div class="p-adBox__img"><a href="//af.moshimo.com/af/c/click?a_id=3220586&#038;p_id=3748&#038;pc_id=9191&#038;pl_id=54902&#038;guid=ON" rel="nofollow" referrerpolicy="no-referrer-when-downgrade"><img decoding="async" src="//image.moshimo.com/af-img/3175/000000054902.jpg" width="468" height="120" style="border:none;"></a><img decoding="async" src="//i.moshimo.com/af/i/impression?a_id=3220586&#038;p_id=3748&#038;pc_id=9191&#038;pl_id=54902" width="1" height="1" style="border:none;"></div></div></div>

<div class="p-blogParts post_content" data-partsID="3676">
<a href="//af.moshimo.com/af/c/click?a_id=3220586&#038;p_id=3748&#038;pc_id=9191&#038;pl_id=52289&#038;guid=ON" rel="nofollow" referrerpolicy="no-referrer-when-downgrade">かしこく、失敗しないスクール選びなら【スクマド】</a><img decoding="async" src="//i.moshimo.com/af/i/impression?a_id=3220586&#038;p_id=3748&#038;pc_id=9191&#038;pl_id=52289" width="1" height="1" style="border:none;">




</div>


<p><span class="swl-marker mark_green"><strong>完全無料で１００個以上あるプログラミングスクールのプランから料金や学習内容、アフターサポートまで明確に比較し、自分にあったスクールをヒアリングしながら一緒に決めてくれる</strong></span>そうです。</p>



<p>こんなサービスができたのかと驚きました&#8230;。<br>せっかく無料なので、<span class="swl-marker mark_yellow">ここでカウンセリングをしてもらいつつ、自分で無料説明会などを実際に聞いたりして最終的に自分で決断するのが現在の最適解かも</span>しれません。</p>



<h3 class="wp-block-heading" id="個人的にオススメのスクール">個人的にオススメのスクール</h3>



<p>以下では個人的に<strong>「過去の自分に教えてあげたい&#8230;」</strong>と感じた<strong>『サブスク型&amp;無料体験or説明会がある』プログラミングスクールを</strong>ご紹介します。</p>



<p>ただ、<span class="swl-marker mark_orange">その前に一つ注意点があります。</span></p>



<p>無料体験や説明会に参加するのを少し面倒に感じて<strong>「もうここで良いや！」</strong>と適当に決めてしまう人が非常に多いのです。（かつての私です&#8230;）</p>



<p>しかし、<span class="swl-marker mark_yellow"><strong>過去の私のように金銭的にも時間的にも損をしないために</strong>、<strong>無料体験や説明会に参加することをお勧めします！</strong></span></p>



<h4 class="wp-block-heading" id="freeks-フリークス">Freeks（フリークス）</h4>



<p class="is-style-big_icon_point">・受講料：<strong>月額9800円</strong>&#8211;<br>・学習言語（<strong>JavaScript</strong>, PHPなど）選び放題！<br>・模擬プロジェクトで要件定義→基本設計…納品までの一連の流れを経験できる！<br>   →<strong>稼げるエンジニアに！</strong></p>


<div class="p-adBox -normal -border-off" data-id="3531" data-ad="normal"><div class="p-adBox__body"><div class="p-adBox__img"><a href="//af.moshimo.com/af/c/click?a_id=3215624&#038;p_id=3878&#038;pc_id=9624&#038;pl_id=53758&#038;guid=ON" rel="nofollow" referrerpolicy="no-referrer-when-downgrade"><img decoding="async" src="//image.moshimo.com/af-img/2271/000000053758.jpg" width="400" height="197" style="border:none;"></a><img decoding="async" src="//i.moshimo.com/af/i/impression?a_id=3215624&#038;p_id=3878&#038;pc_id=9624&#038;pl_id=53758" width="1" height="1" style="border:none;"></div></div></div>


<div class="swell-block-button is-style-btn_normal"><a href="//af.moshimo.com/af/c/click?a_id=3215624&amp;p_id=3878&amp;pc_id=9624&amp;pl_id=53722&amp;guid=ON" class="swell-block-button__link"><span>Freeks 無料説明会はこちら</span></a></div>



<p>個人的にオススメなのはFreeksというスクールです。<br>ググりまくって<strong>「これは&#8230;！」</strong>と思ったのでご紹介します。</p>



<p>私の通っていたプログラミングスクールは、実務については何も教えてくれませんでした。</p>



<p>そのため実際に仕事を受注しようと思ったときは不安で、<span class="swl-marker mark_orange"><strong>『プログラミングはできるが、仕事が受けれない』というカオスな状態</strong></span>に陥ってしまいました。</p>



<p>「模擬プロジェクト」、良いシステムだと思います。</p>



<p>プログラミングは仕事をすることがゴールと考えると、絶対に必要な体験ですよね。</p>



<p>もし、今自分が過去に戻ったら、ここに行くのではないかと思います。</p>



<h2 class="wp-block-heading" id="終わりに">終わりに</h2>



<figure class="wp-block-image size-full"><img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/uploads/2022/02/データ-14.jpg" alt="" class="wp-image-3721" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/データ-14.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-14-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-14-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>今回は、プログラミングの基礎を理解した人が、副業で稼げるようになるための３つの方法をご紹介しました。</p>



<p>プログラミングは今の時代、出来て当たり前なものになりつつあります。<br><strong>時代に乗り遅れないためにもプログラミング学習は必須</strong>でしょう。</p>



<p>また、副業でお金が稼げるようになると、人生の自由度が大きく上がります<br><span class="swl-marker mark_yellow">iPhoneショートカットの作成に留まらず、多くの人にそのプログラミングスキルを提供して欲しい</span>です！</p>



<p>本記事で紹介した方法で、1人でも多くの方が目標を達成できることを願っております！<br>最後まで読んでいただいてありがとうございました！</p>



<h4 class="wp-block-heading" id="プログラミング教室の記事一覧">プログラミング教室の記事一覧</h4>


<div class="p-postListWrap  "><ul class="p-postList -type-list"><li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/how-to-earn/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【経験談あり】プログラミングの基礎を理解した後、副業で稼ぐ３つの方法を解説！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-06">2022.02.06</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/difference-proggraming/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【超簡単】iPhoneの「ショートカット」アプリでプログラミング学習を始めよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-01-30">2022.01.30</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/three-factors/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">iPhoneショートカットの「スクリプティング」とは？プログラミングの基本3要素を理解しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-01">2022.02.01</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/what-is-variable/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【徹底解説！】「変数」って何？iPhoneショートカットを作りながらマスターしよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-03">2022.02.03</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/how-use-if/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【if文をマスターする！】iPhoneショートカットで条件分岐を完全理解しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-04">2022.02.04</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/how-repeat/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">「繰り返す」や「リスト」をiPhoneショートカットで使いこなそう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-05">2022.02.05</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/iphone-javascript/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">「JavaScript」とは？iPhoneショートカットで実行する方法を徹底解説！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-06">2022.02.06</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/javascript-variable-list/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">JavaScriptで「変数」と「配列」を扱う方法を学習しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-09">2022.02.09</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/javascript-if-for/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">「条件分岐」「繰り返し」をJavaScriptで行う方法を理解しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-11">2022.02.11</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/webapi-dict/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">Web APIって何？iPhoneショートカットで活用する方法！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-13">2022.02.13</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/shortcuts-webapi-practice/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">実践！iPhoneショートカットでWeb APIを使いこなそう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-19">2022.02.19</time>
		</div>
				</div>
			</div>
			</a>
</li>
</ul></div><p>The post <a href="https://automa-recipe.com/learn-programming/how-to-earn/">【経験談あり】プログラミングの基礎を理解した後、副業で稼ぐ３つの方法を解説！</a> first appeared on <a href="https://automa-recipe.com">オートクック！</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://automa-recipe.com/learn-programming/how-to-earn/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>「繰り返す」や「リスト」をiPhoneショートカットで使いこなそう！</title>
		<link>https://automa-recipe.com/learn-programming/how-repeat/</link>
					<comments>https://automa-recipe.com/learn-programming/how-repeat/#comments</comments>
		
		<dc:creator><![CDATA[automa-recipe]]></dc:creator>
		<pubDate>Sat, 05 Feb 2022 06:23:18 +0000</pubDate>
				<category><![CDATA[プログラミング教室]]></category>
		<category><![CDATA[まとめ]]></category>
		<guid isPermaLink="false">https://automa-recipe.com/?p=3680</guid>

					<description><![CDATA[<p><img src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー.jpg" class="webfeedsFeaturedVisual" /></p><p>「繰り返す」「リスト」といったアクションは、「便利そうだけど、使い方がよく分からない…」と思っている方が多いと思います。 しかし、実際には難しいことはなく、正しい理解と少しの実践があれば誰でも簡単に使いこなすことができま [&#8230;]</p>
<p>The post <a href="https://automa-recipe.com/learn-programming/how-repeat/">「繰り返す」や「リスト」をiPhoneショートカットで使いこなそう！</a> first appeared on <a href="https://automa-recipe.com">オートクック！</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><img src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー.jpg" class="webfeedsFeaturedVisual" /></p><p>「繰り返す」「リスト」といったアクションは、<br><strong>「便利そうだけど、使い方がよく分からない…」</strong><br>と思っている方が多いと思います。</p>



<p>しかし、実際には難しいことはなく、<span class="swl-marker mark_yellow">正しい理解と少しの実践があれば誰でも簡単に使いこなすことができます。</span></p>



<p>【<a href="https://automa-recipe.com/programming_articles/" title="【iOSショートカットで学ぶ】プログラミング教室">iOSショートカットで学ぶ！プログラミング教室</a>】シリーズ <a href="https://automa-recipe.com/learn-programming/three-factors/" title="iPhoneショートカットの「スクリプティング」とは？プログラミングの基本3要素を理解しよう！">第２回</a>では、プログラミングの基本要素「反復」について学びました。</p>


<div class="swell-block-postLink" data-style="card">			<a href="https://automa-recipe.com/learn-programming/three-factors/" class="p-blogCard -internal" data-type="type3">
			<div class="p-blogCard__inner">
				<span class="p-blogCard__caption">あわせて読みたい</span>
				<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー-300x169.jpg" alt="" class="c-postThumb__img -no-lb"></figure></div>				<div class="p-blogCard__body">
					<span class="p-blogCard__title">iPhoneショートカットの「スクリプティング」とは？プログラミングの基本3要素を理解しよう！</span>
					<span class="p-blogCard__excerpt">iOSショートカットを作成する時に、アクションの追加画面には「スクリプティング」項目が出てきますよね。ショートカットを作ったことがある方なら、一度は見たことがあ&#8230;</span>				</div>
			</div></a>
		</div>


<p>ついに初級編の最終回となった第５回の本記事では、</p>



<ul class="is-style-check_list wp-block-list"><li><strong>「反復」とは何か？（復習）</strong></li><li><strong>「反復」を可能にするアクション３つ</strong></li><li><strong>無限ループ</strong></li></ul>



<p>について解説していきます！</p>



<p>また、最後にショートカットを作りながらアウトプットする実践編では、<br>本記事で学ぶ「繰り返す」系のアクションに加えて「if文」「メニューから選択」アクションも使います。</p>



<p>もし、「if文」「メニューから選択」アクションの使い方がよく分からない方は、<a href="https://automa-recipe.com/learn-programming/how-use-if/" title="【if文をマスターする！】iPhoneショートカットで条件分岐を完全理解しよう！">前回の記事</a>をご覧ください！</p>


<div class="swell-block-postLink" data-style="card">			<a href="https://automa-recipe.com/learn-programming/how-use-if/" class="p-blogCard -internal" data-type="type3">
			<div class="p-blogCard__inner">
				<span class="p-blogCard__caption">あわせて読みたい</span>
				<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-300x169.jpg" alt="" class="c-postThumb__img -no-lb"></figure></div>				<div class="p-blogCard__body">
					<span class="p-blogCard__title">【if文をマスターする！】iPhoneショートカットで条件分岐を完全理解しよう！</span>
					<span class="p-blogCard__excerpt">iOSでショートカットを作っているとき、「if文」というアクションをよく見かけると思います。 「なんだか難しそう…」と多くの方が思っていることでしょう。 しかし、慣&#8230;</span>				</div>
			</div></a>
		</div>


<p>それでは、Let’s プログラミング！</p>



<div class="swell-toc-placeholder"></div>



<h2 class="wp-block-heading" id="反復-とは">「反復」とは？</h2>



<figure class="wp-block-image size-full"><img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/uploads/2022/02/データ-10.jpg" alt="" class="wp-image-3710" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/データ-10.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-10-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-10-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>第２回で既に学んだ方は復習になりますが、念の為もう一度解説しておきます。</p>



<p><strong><span class="swl-marker mark_yellow">「反復」とは、ある特定の処理を繰り返すこと</span></strong>です。</p>



<p>「反復」はプログラミングの基本３要素のうちの一つで、ショートカット作り（＝プログラミング）をする上で、必要不可欠なものになります。</p>



<p>プログラミングと聞くと、難しく感じる方も多いかもしれません。</p>



<p>ただ、日常生活においても「反復」はよく起きていることなのです。</p>



<p>例えば、<br><strong>「スクワットを10回する」</strong><br>というのも立派な反復です。</p>



<p>そう考えると、理解しやすいのではないでしょうか？</p>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5725212284208116"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5725212284208116"
     data-ad-slot="2014468485"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h2 class="wp-block-heading" id="反復-をするためのアクション３つ">「反復」をするためのアクション３つ</h2>



<figure class="wp-block-image size-full"><img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/uploads/2022/02/データ-11.jpg" alt="" class="wp-image-3711" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/データ-11.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-11-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-11-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>この特定の処理を繰り返す「反復」を行うために、ショートカットには大きく３つのアクションが用意されています。</p>



<p>一つ一つ解説していきます。</p>



<h3 class="wp-block-heading" id="1つ目のアクション-繰り返す">1つ目のアクション：「繰り返す」</h3>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/1-1.jpeg" alt="" class="wp-image-3681" width="357" height="141" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/1-1.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/1-1-300x118.jpeg 300w" sizes="(max-width: 357px) 100vw, 357px" /></figure></div>



<p>まずは基本中の基本である<strong>「繰り返す」</strong>アクションです。</p>



<p>「繰り返す」アクションは、繰り返したい処理を決められた回数実行してくれます。</p>



<p>実際のショートカット作成画面で見てみましょう。</p>



<p>↓ 「繰り返す」アクションを置いただけの状態</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/2-2.jpeg" alt="" class="wp-image-3682" width="342" height="194" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/2-2.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/2-2-300x170.jpeg 300w" sizes="(max-width: 342px) 100vw, 342px" /></figure></div>







<p>↓ 繰り返したい処理を入れてみた状態</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/3-1.jpeg" alt="" class="wp-image-3683" width="335" height="277" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/3-1.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/3-1-300x248.jpeg 300w" sizes="(max-width: 335px) 100vw, 335px" /></figure></div>



<p>このショートカットを実行すると、<strong>「”アラートです！”と表示する」処理を５回繰り返す</strong>ことになります。</p>



<p>このように<span class="swl-marker mark_yellow">「繰り返す」アクションを使えば、任意の処理を好きな回数実行することができる</span>のです。</p>



<p>もちろん、「5回」という回数を「10回」「20回」と増やすこともできます。</p>



<p>何度も同じ処理をしたい時には便利なアクションです。</p>



<h3 class="wp-block-heading" id="2つ目のアクション-リスト">2つ目のアクション：「リスト」</h3>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/4.jpeg" alt="" class="wp-image-3684" width="318" height="253" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/4.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/4-300x239.jpeg 300w" sizes="(max-width: 318px) 100vw, 318px" /></figure></div>



<p>続いて、「リスト」アクションを解説します。</p>



<p>ショートカットの作成画面で、「リスト」アクションを置いてみると以下のようになります。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/5-1.jpeg" alt="" class="wp-image-3685" width="311" height="238" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/5-1.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/5-1-300x229.jpeg 300w" sizes="(max-width: 311px) 100vw, 311px" /></figure></div>







<p>デフォルトでは「1件」「2件」とデータが２つ入っていますが、その内容や数は自由に調整できます。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/6-1.jpeg" alt="" class="wp-image-3686" width="298" height="210" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/6-1.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/6-1-300x211.jpeg 300w" sizes="(max-width: 298px) 100vw, 298px" /></figure></div>







<p><strong>「変数を追加」</strong>というアクションを覚えていますか？<br>第3回の記事で説明したものです。</p>


<div class="swell-block-postLink" data-style="card">			<a href="https://automa-recipe.com/learn-programming/what-is-variable/" class="p-blogCard -internal" data-type="type3">
			<div class="p-blogCard__inner">
				<span class="p-blogCard__caption">あわせて読みたい</span>
				<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー-300x169.jpg" alt="" class="c-postThumb__img -no-lb"></figure></div>				<div class="p-blogCard__body">
					<span class="p-blogCard__title">【徹底解説！】「変数」って何？iPhoneショートカットを作りながらマスターしよう！</span>
					<span class="p-blogCard__excerpt">iOSショートカットの作成において、「変数」は非常に重要です。 「変数」を制すものがショートカットを制す、と言っても過言ではないでしょう。 しかし、ショートカット&#8230;</span>				</div>
			</div></a>
		</div>


<p><span class="swl-marker mark_orange">設定された変数に新しいデータを追加し、複数のデータを１つの変数の中に入れることができるアクション</span>でした。</p>



<p>複数のデータが１つの変数の中には入っているという状態、これはリストと全く同じ働きをしています。</p>



<p><strong>「じゃあ、リストではなく変数で良いのは？」</strong></p>



<p>と思った方もいると思います。</p>



<p>しかし、<strong><span class="swl-marker mark_orange">「できれば変数を使うことは避けたい」</span></strong>です。</p>



<p>これは<a href="https://support.apple.com/ja-jp/guide/shortcuts/apdd2b316022/ios">Apple公式の「ショートカット ユーザーガイト」</a>にも書いてあることですが、変数を使うとプログラムが長くなり読みにくくなってしまうからです。</p>



<p>変数で「リスト」と同じ機能を再現しようとすると、<br><strong>・「変数を設定」<br>・「変数を追加」</strong><br>という２つのアクションが必要になってしまいます。</p>



<p><span class="swl-marker mark_yellow">「リスト」はたった１つのアクションで、変数の２つのアクションの機能を、ほぼ代替できてしまう</span>のです。</p>



<p>基本的にプログラミングをする際は、簡潔なプログラムを作ることが重要です。<br>ミスの原因が特定しやすくなりますし、他の人にプログラムを見せた時に理解してもらいやすくなるからです。</p>



<p>以上のような点から、リストと変数のどちらを使うか迷った時は「リスト」を選択すべきだと言えるわけです。</p>



<h3 class="wp-block-heading" id="３つ目のアクション-各項目を繰り返す">３つ目のアクション：「各項目を繰り返す」</h3>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/7-2.jpeg" alt="" class="wp-image-3688" width="282" height="101" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/7-2.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/7-2-300x108.jpeg 300w" sizes="(max-width: 282px) 100vw, 282px" /></figure></div>



<p>最後に<strong>「各項目を繰り返す」</strong>アクションを解説します。</p>



<p><span class="swl-marker mark_yellow">「各項目を繰り返す」アクションは指定したリスト内の項目を一つ一つ取り出して、指定した処理を実行することができます。</span></p>



<p>ショートカット作成画面で「各項目を繰り返す」アクションを追加した状態を見てみましょう。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/8-1.jpeg" alt="" class="wp-image-3689" width="287" height="149" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/8-1.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/8-1-300x156.jpeg 300w" sizes="(max-width: 287px) 100vw, 287px" /></figure></div>







<p>「”項目”の各項目を繰り返す」の”項目”にはリストを設定します。<br>「リスト」アクションを追加し、”項目”の箇所に設定すると以下のようになります。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/9-1-743x1024.jpeg" alt="" class="wp-image-3690" width="285" height="393" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/9-1-743x1024.jpeg 743w, https://automa-recipe.com/wp-content/uploads/2022/02/9-1-218x300.jpeg 218w, https://automa-recipe.com/wp-content/uploads/2022/02/9-1.jpeg 750w" sizes="(max-width: 285px) 100vw, 285px" /></figure></div>







<p>そして、「テキスト」アクションを「”リスト”の各項目を繰り返す」の下に追加し、テキスト内で「変数を選択」をタップしてみましょう。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/10-1-589x1024.jpeg" alt="" class="wp-image-3691" width="277" height="482" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/10-1-589x1024.jpeg 589w, https://automa-recipe.com/wp-content/uploads/2022/02/10-1-173x300.jpeg 173w, https://automa-recipe.com/wp-content/uploads/2022/02/10-1.jpeg 713w" sizes="(max-width: 277px) 100vw, 277px" /></figure></div>







<p>すると、「”リスト”の各項目を繰り返す」アクションの下に「Repeat Index」と「Repeat Item」という項目が出てきます。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/11-1-594x1024.jpeg" alt="" class="wp-image-3693" width="261" height="450" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/11-1-594x1024.jpeg 594w, https://automa-recipe.com/wp-content/uploads/2022/02/11-1-174x300.jpeg 174w, https://automa-recipe.com/wp-content/uploads/2022/02/11-1.jpeg 719w" sizes="(max-width: 261px) 100vw, 261px" /></figure></div>







<ul class="is-style-check_list wp-block-list"><li><strong>「Repeat Item（繰り返し項目）」はリストから取り出された各項目のデータの内容</strong></li><li><strong>「Repeat Index（繰り返し番号）」はリストから取り出した各項目が何番目のデータか</strong></li></ul>



<p>ということを表しています。</p>



<p>図にすると以下のようなイメージです。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/12.png" alt="" class="wp-image-3694" width="606" height="341" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/12.png 960w, https://automa-recipe.com/wp-content/uploads/2022/02/12-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/12-768x432.png 768w" sizes="(max-width: 606px) 100vw, 606px" /></figure></div>







<p>では、先ほどまでのショートカットのテキストアクション内に「”Repeat Index”番目の人は”Repeat Item”です」と設定してみましょう。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/13-1-597x1024.jpeg" alt="" class="wp-image-3695" width="272" height="467" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/13-1-597x1024.jpeg 597w, https://automa-recipe.com/wp-content/uploads/2022/02/13-1-175x300.jpeg 175w, https://automa-recipe.com/wp-content/uploads/2022/02/13-1.jpeg 723w" sizes="(max-width: 272px) 100vw, 272px" /></figure></div>







<p>そしてショートカットを実行してみると、「1番目の人は太郎です」と出力され、結果画面を右にスワイプすると「2番目の人は花子です」「3番目の人はマイケルです」と出力されているのが分かります。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/14-1-594x1024.jpeg" alt="" class="wp-image-3696" width="251" height="433" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/14-1-594x1024.jpeg 594w, https://automa-recipe.com/wp-content/uploads/2022/02/14-1-174x300.jpeg 174w, https://automa-recipe.com/wp-content/uploads/2022/02/14-1.jpeg 719w" sizes="(max-width: 251px) 100vw, 251px" /></figure></div>







<p>このように、<strong><span class="swl-marker mark_orange">「各項目を繰り返す」アクションでは「Repeat Index」「Repeat Item」を使ってリスト内の項目を処理できる</span></strong>のです。</p>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5725212284208116"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5725212284208116"
     data-ad-slot="2014468485"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h4 class="wp-block-heading" id="リスト-は-リスト-アクション以外でも作れる">&#8220;リスト&#8221;は「リスト」アクション以外でも作れる！</h4>



<p>先ほどは「各項目を繰り返す」アクションの入力（「”項目”の各項目を繰り返す」の”項目”）部分に、事前に「リスト」アクションで作ったものを設定しました。</p>



<p>しかし、<span class="swl-marker mark_orange">「各項目を繰り返す」アクションの入力には、<strong>「リスト」アクション以外の”リスト”</strong>も設定することができます。</span></p>



<p><strong>「何を言っているんだ？」</strong></p>



<p>と感じる方も多いと思います。</p>



<p>実は、そもそも「<strong>”リスト”＝複数のデータを持つもの</strong>」であり、<strong>&#8220;リスト&#8221;</strong>は「リスト」アクションを使わなくても作ることができるのです。</p>



<p>例えば、<br><strong>「リマインダーを検索」というアクションでは、</strong>特定の条件と一致するリマインダーを検索し、条件と一致する<strong>複数のリマインダーを”リスト”として出力</strong>します。</p>



<p>このように、<span class="swl-marker mark_yellow">「リスト」アクション以外にも、複数のデータを持つことになるアクションは結果として”リスト”を出力</span>します。</p>



<p>すなわち、「各項目を繰り返す」アクションは入力に「リスト」アクションで作った<strong>”リスト”（複数のデータを持つもの）</strong>以外にも、<strong>他のアクションの結果（複数のデータを持つもの＝”リスト”）</strong>を受け取ることができるということです。</p>



<p>ちなみに、<br><span class="swl-marker mark_orange">「繰り返す」「各項目を繰り返す」アクションの結果を出力した<strong>「繰り返しの結果」も”リスト”</strong>です。</span></p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/15-2.jpeg" alt="" class="wp-image-3697" width="279" height="369" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/15-2.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/15-2-227x300.jpeg 227w" sizes="(max-width: 279px) 100vw, 279px" /></figure></div>



<p><br>リストに繰り返し処理が行われ、結果のリストが出力されるまでのイメージは以下のような具合です。<br></p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/16.png" alt="" class="wp-image-3698" width="606" height="341" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/16.png 960w, https://automa-recipe.com/wp-content/uploads/2022/02/16-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/16-768x432.png 768w" sizes="(max-width: 606px) 100vw, 606px" /></figure></div>







<p><strong>&#8220;リスト&#8221;は「リスト」アクション以外でも作れる</strong>というイメージを掴んでいただけたでしょうか？</p>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5725212284208116"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5725212284208116"
     data-ad-slot="2014468485"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h2 class="wp-block-heading" id="実践編-今日が期限のリマインダーを表示するショートカット">【実践編】今日が期限のリマインダーを表示するショートカット</h2>



<figure class="wp-block-image size-full"><img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/uploads/2022/02/データ-12.jpg" alt="" class="wp-image-3712" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/データ-12.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-12-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-12-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>これまで、「反復」を実現するアクションについて解説してきました。</p>



<p>いよいよ実践編です。</p>



<p>作るのは<strong>「今日が期限となっているリマインダーを表示する」</strong>ショートカットです。</p>



<p>「if文」「メニューから選択」などを使い、前回の内容の復習にもなっていますので、少し難易度は高くなっていますが一緒に作って理解を深めていきましょう！</p>



<p>作成するショートカットの大まかな流れです。</p>



<p class="has-border -border02">1. 期限が今日になっているリマインダーを検索する。<br>2. 検索結果のリマインダーの各項目で「何番目のリマインダー」で「内容は何か」をテキストに設定する。<br>3. もし、リマインダーを検索して値があれば、アラートで上のテキストを表示する。<br>4. もし、リマインダーを検索しても値がない場合には、「もう一度検索するorしない」を尋ねる。<br>　 →検索する場合は、ショートカットを再実行する</p>



<p>かなり複雑でイメージしにくいと思いますので、以下のリンクからダウンロードして使ってみてください！</p>



<p><a href="https://www.icloud.com/shortcuts/b21af084ce0c49279346b7766422b5f7">https://www.icloud.com/shortcuts/b21af084ce0c49279346b7766422b5f7</a></p>



<p>イメージを掴めたら、実際に作っていきましょう！</p>



<p>① 新規ショートカットの作成画面から「アクションを追加」を選択し、検索欄に「リマインダーを検索」と入力しアクションを追加します。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/17-1.jpeg" alt="" class="wp-image-3699" width="294" height="258" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/17-1.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/17-1-300x264.jpeg 300w" sizes="(max-width: 294px) 100vw, 294px" /></figure></div>







<p>② 追加したアクションの「フィルタを追加」をタップし、フィルタ内の”リスト”をタップし”期限”に変える。そして”次に完全一致”をタップし”今日である”に変える。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/18-1.jpeg" alt="" class="wp-image-3700" width="293" height="271" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/18-1.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/18-1-300x278.jpeg 300w" sizes="(max-width: 293px) 100vw, 293px" /></figure></div>







<p>③ 「各項目を繰り返す」アクションを追加し、「”リマインダー”の各項目を繰り返す」となっていることを確認する。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/19-1.jpeg" alt="" class="wp-image-3701" width="289" height="388" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/19-1.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/19-1-223x300.jpeg 223w" sizes="(max-width: 289px) 100vw, 289px" /></figure></div>







<p>④ 「テキスト」アクションを「”リマインダー”の各項目を繰り返す」の下に配置し、テキストの中が「”繰り返しインデックス（Repeat Index）”番目は”繰り返し項目（Repeat Item）”」となるよう設定する。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/20-1-601x1024.jpeg" alt="" class="wp-image-3702" width="263" height="448" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/20-1-601x1024.jpeg 601w, https://automa-recipe.com/wp-content/uploads/2022/02/20-1-176x300.jpeg 176w, https://automa-recipe.com/wp-content/uploads/2022/02/20-1.jpeg 728w" sizes="(max-width: 263px) 100vw, 263px" /></figure></div>







<p>⑤ 「繰り返しの終了」の下に「if文」アクションを追加し、「もし”繰り返し項目”が”任意の値”ならば」となるよう設定する。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/IMG_E9E82DEB11E8-1-598x1024.jpeg" alt="" class="wp-image-3707" width="255" height="437" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/IMG_E9E82DEB11E8-1-598x1024.jpeg 598w, https://automa-recipe.com/wp-content/uploads/2022/02/IMG_E9E82DEB11E8-1-175x300.jpeg 175w, https://automa-recipe.com/wp-content/uploads/2022/02/IMG_E9E82DEB11E8-1.jpeg 724w" sizes="(max-width: 255px) 100vw, 255px" /></figure></div>







<p>⑥ 「もし”繰り返し項目”が”任意の値”ならば」の下に「アラートを表示」アクションを追加し、「アラート”テキスト”を表示」となるように設定する。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/21-2-600x1024.jpeg" alt="" class="wp-image-3703" width="267" height="456" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/21-2-600x1024.jpeg 600w, https://automa-recipe.com/wp-content/uploads/2022/02/21-2-176x300.jpeg 176w, https://automa-recipe.com/wp-content/uploads/2022/02/21-2.jpeg 726w" sizes="(max-width: 267px) 100vw, 267px" /></figure></div>







<p>⑦ 「その他の場合」の下に「メニューから選択」アクションを追加し、メッセージを「見つかりませんでした、再検索しますか？”」に、選択肢を「はい」と「いいえ」に設定。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/22-2-594x1024.jpeg" alt="" class="wp-image-3705" width="255" height="440" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/22-2-594x1024.jpeg 594w, https://automa-recipe.com/wp-content/uploads/2022/02/22-2-174x300.jpeg 174w, https://automa-recipe.com/wp-content/uploads/2022/02/22-2.jpeg 719w" sizes="(max-width: 255px) 100vw, 255px" /></figure></div>







<p>⑧ 「はい」の下に「ショートカットを実行」アクションを追加し、現在のショートカットを実行するように設定する。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/23-1-594x1024.jpeg" alt="" class="wp-image-3706" width="243" height="419" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/23-1-594x1024.jpeg 594w, https://automa-recipe.com/wp-content/uploads/2022/02/23-1-174x300.jpeg 174w, https://automa-recipe.com/wp-content/uploads/2022/02/23-1.jpeg 719w" sizes="(max-width: 243px) 100vw, 243px" /></figure></div>



<p>作成完了です！</p>



<p>初級編の最終回にふさわしい、難易度の高いショートカットですね&#8230;。</p>



<p>これだけのものが独力で作れたら、プログラミングの基本が身についている証拠だと思います。</p>



<p>最後に<strong>「無限ループ」</strong>の補足をさせてください！</p>



<h4 class="wp-block-heading" id="無限ループとは">無限ループとは？</h4>



<p><strong><span class="swl-marker mark_yellow">あるショートカットAの中で「ショートカットAを実行」することで、何度もショートカットAの実行を繰り返すことを、無限ループ</span></strong>と言います。</p>



<p><span class="swl-marker mark_orange">無限ループの状態になると、そのショートカットを停止するまで、ショートカット内のアクションが最初から最後まで繰り返し実行される</span>ことになります。</p>



<p>先ほどショートカットを作成する時、⑧で</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>「はい」の下に「ショートカットを実行」アクションを追加し、現在のショートカットを実行するように設定する。</p></blockquote>



<p>ということをしたと思います。</p>



<p>「再検索しますか？」という質問に対して「はい」を選択すると、もう一度最初からショートカットを実行するようにしたわけです。</p>



<p>しかし、再検索をしたとしても「リマインダーの検索結果」は変わらず「値がない」ままですよね。</p>



<p>つまり、<span class="swl-marker mark_yellow">「再検索しますか？」という質問に対して「はい」を選択し続けると無限にショートカットが実行され、「いいえ」を選ぶと無限ループから抜けられる状況を作った</span>ということです。</p>



<p><strong>「何のためにそんなことを？」</strong></p>



<p>と思っている方も多いでしょう。</p>



<p>今回作ったショートカットの場合は、特に意味はなく「無限ループ」の解説のためにあえて作りました。</p>



<p>しかし、<strong>「ショートカットを実行」アクションを使って「無限ループ」にすることで、実現できることが増える</strong>のは確かです。</p>



<p><span class="swl-marker mark_orange">使う場面は少ないですが、<strong>「こんなこともできる」と知っておくと必ず役に立つ知識</strong>ですので</span>ご紹介させていただきました。</p>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5725212284208116"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5725212284208116"
     data-ad-slot="2014468485"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h2 class="wp-block-heading" id="終わりに">終わりに</h2>



<figure class="wp-block-image size-full"><img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/uploads/2022/02/データ-13.jpg" alt="" class="wp-image-3713" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/データ-13.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-13-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-13-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>「iOSショートカットで学ぶ！プログラミング教室」第５回となった本記事では、</p>



<ul class="is-style-check_list wp-block-list"><li><strong>「反復」とは何か？（復習）</strong></li><li><strong>「反復」を可能にするアクション３つ</strong></li><li><strong>無限ループ</strong></li></ul>



<p>などについて解説しました！</p>



<p>今回の内容もかなりボリューミーだったと思いますが、何度も読み返して理解を深めていただければ幸いです。</p>



<p><span class="swl-marker mark_orange">ついに「iOSショートカットで学ぶ！プログラミング教室」初級編が終了</span>しました。</p>



<p><span class="swl-marker mark_yellow">ここまでの内容を理解できた方は、プログラミングの基礎は十分身についたと自信を持って良い</span>と思います。</p>



<p>ついに次回より<strong>上級編</strong>に突入します。<br>専門用語が増えるので理解が難しいところもあるかもしれませんが、なるべく分かりやすく噛み砕いて解説していきますので、お楽しみに！</p>



<p>次回の記事は<a href="https://automa-recipe.com/learn-programming/iphone-javascript/" title="「JavaScript」とは？iPhoneショートカットで実行する方法を徹底解説！">こちら！</a></p>


<div class="swell-block-postLink" data-style="card">			<a href="https://automa-recipe.com/learn-programming/iphone-javascript/" class="p-blogCard -internal" data-type="type3">
			<div class="p-blogCard__inner">
				<span class="p-blogCard__caption">あわせて読みたい</span>
				<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1-300x169.png" alt="" class="c-postThumb__img -no-lb"></figure></div>				<div class="p-blogCard__body">
					<span class="p-blogCard__title">「JavaScript」とは？iPhoneショートカットで実行する方法を徹底解説！</span>
					<span class="p-blogCard__excerpt">iOSやMacで使えるショートカットアプリは、JavaScriptを実行できる。 そのようなことを聞いても 「なんとなく凄いのは分かるけど、イマイチ何ができるのか分からない…」&#8230;</span>				</div>
			</div></a>
		</div>


<h4 class="wp-block-heading" id="プログラミング教室の記事一覧">プログラミング教室の記事一覧</h4>


<div class="p-postListWrap  "><ul class="p-postList -type-list"><li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/how-to-earn/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【経験談あり】プログラミングの基礎を理解した後、副業で稼ぐ３つの方法を解説！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-06">2022.02.06</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/difference-proggraming/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【超簡単】iPhoneの「ショートカット」アプリでプログラミング学習を始めよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-01-30">2022.01.30</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/three-factors/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">iPhoneショートカットの「スクリプティング」とは？プログラミングの基本3要素を理解しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-01">2022.02.01</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/what-is-variable/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【徹底解説！】「変数」って何？iPhoneショートカットを作りながらマスターしよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-03">2022.02.03</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/how-use-if/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【if文をマスターする！】iPhoneショートカットで条件分岐を完全理解しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-04">2022.02.04</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/how-repeat/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">「繰り返す」や「リスト」をiPhoneショートカットで使いこなそう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-05">2022.02.05</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/iphone-javascript/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">「JavaScript」とは？iPhoneショートカットで実行する方法を徹底解説！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-06">2022.02.06</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/javascript-variable-list/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">JavaScriptで「変数」と「配列」を扱う方法を学習しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-09">2022.02.09</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/javascript-if-for/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">「条件分岐」「繰り返し」をJavaScriptで行う方法を理解しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-11">2022.02.11</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/webapi-dict/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">Web APIって何？iPhoneショートカットで活用する方法！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-13">2022.02.13</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/shortcuts-webapi-practice/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">実践！iPhoneショートカットでWeb APIを使いこなそう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-19">2022.02.19</time>
		</div>
				</div>
			</div>
			</a>
</li>
</ul></div><p>The post <a href="https://automa-recipe.com/learn-programming/how-repeat/">「繰り返す」や「リスト」をiPhoneショートカットで使いこなそう！</a> first appeared on <a href="https://automa-recipe.com">オートクック！</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://automa-recipe.com/learn-programming/how-repeat/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>【if文をマスターする！】iPhoneショートカットで条件分岐を完全理解しよう！</title>
		<link>https://automa-recipe.com/learn-programming/how-use-if/</link>
					<comments>https://automa-recipe.com/learn-programming/how-use-if/#comments</comments>
		
		<dc:creator><![CDATA[automa-recipe]]></dc:creator>
		<pubDate>Fri, 04 Feb 2022 10:07:47 +0000</pubDate>
				<category><![CDATA[プログラミング教室]]></category>
		<category><![CDATA[まとめ]]></category>
		<guid isPermaLink="false">https://automa-recipe.com/?p=3622</guid>

					<description><![CDATA[<p><img src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー.jpg" class="webfeedsFeaturedVisual" /></p><p>iOSでショートカットを作っているとき、「if文」というアクションをよく見かけると思います。 「なんだか難しそう…」と多くの方が思っていることでしょう。 しかし、慣れてしまえば「if文」は簡単に扱うことができます。 「i [&#8230;]</p>
<p>The post <a href="https://automa-recipe.com/learn-programming/how-use-if/">【if文をマスターする！】iPhoneショートカットで条件分岐を完全理解しよう！</a> first appeared on <a href="https://automa-recipe.com">オートクック！</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><img src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー.jpg" class="webfeedsFeaturedVisual" /></p><p>iOSでショートカットを作っているとき、<strong>「if文」</strong>というアクションをよく見かけると思います。</p>



<p><strong>「なんだか難しそう…」</strong>と多くの方が思っていることでしょう。</p>



<p>しかし、<span class="swl-marker mark_yellow">慣れてしまえば「if文」は簡単に扱うことができます。</span></p>



<p><span class="swl-marker mark_orange">「if文」は<strong>”条件分岐”</strong>という<strong>プログラミングの基本３要素の一つ</strong>です。</span></p>



<p>そして、<strong>”ショートカット作り＝プログラミング”</strong> なので、プログラミングの基本要素である<span class="swl-marker mark_yellow">「条件分岐」をマスターすることは、iOSショートカット作り上達のためには絶対に必要となります。</span></p>



<p><strong>「ショートカット作り＝プログラミング」<br>「プログラミングの基本３要素」</strong></p>



<p>以上の２点については【<a href="https://automa-recipe.com/programming_articles/" title="【iOSショートカットで学ぶ】プログラミング教室">iOSショートカットで学ぶ！プログラミング教室</a>】シリーズ <a href="https://automa-recipe.com/learn-programming/difference-proggraming/" title="【超簡単】iPhoneの「ショートカット」アプリでプログラミング学習を始めよう！">第１回</a>、<a href="https://automa-recipe.com/learn-programming/three-factors/" title="iPhoneショートカットの「スクリプティング」とは？プログラミングの基本3要素を理解しよう！">第２回</a>の記事で詳しく解説していますので、先にそちらをご覧いただけると理解が深まると思います。</p>


<div class="swell-block-postLink" data-style="card">			<a href="https://automa-recipe.com/learn-programming/difference-proggraming/" class="p-blogCard -internal" data-type="type3">
			<div class="p-blogCard__inner">
				<span class="p-blogCard__caption">あわせて読みたい</span>
				<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5-300x169.jpg" alt="" class="c-postThumb__img -no-lb"></figure></div>				<div class="p-blogCard__body">
					<span class="p-blogCard__title">【超簡単】iPhoneの「ショートカット」アプリでプログラミング学習を始めよう！</span>
					<span class="p-blogCard__excerpt">みなさん、iOSの「ショートカット」アプリ使ってますか？ iPhoneやiPadだけでなく、Macでもショートカットアプリが使えるようになり、自動化・効率化に大活躍ですね。 &#8230;</span>				</div>
			</div></a>
		</div>

<div class="swell-block-postLink" data-style="card">			<a href="https://automa-recipe.com/learn-programming/three-factors/" class="p-blogCard -internal" data-type="type3">
			<div class="p-blogCard__inner">
				<span class="p-blogCard__caption">あわせて読みたい</span>
				<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー-300x169.jpg" alt="" class="c-postThumb__img -no-lb"></figure></div>				<div class="p-blogCard__body">
					<span class="p-blogCard__title">iPhoneショートカットの「スクリプティング」とは？プログラミングの基本3要素を理解しよう！</span>
					<span class="p-blogCard__excerpt">iOSショートカットを作成する時に、アクションの追加画面には「スクリプティング」項目が出てきますよね。ショートカットを作ったことがある方なら、一度は見たことがあ&#8230;</span>				</div>
			</div></a>
		</div>


<p>【iOSショートカットで学ぶ！プログラミング教室】第４回の本記事では、<span class="swl-marker mark_orange"><strong>ショートカットを実際に作りながら「条件分岐」をマスター</strong>していきます！</span></p>



<p>それでは、Let’s プログラミング！</p>



<div class="swell-toc-placeholder"></div>



<h2 class="wp-block-heading" id="条件分岐って何">条件分岐って何？</h2>



<figure class="wp-block-image size-full"><img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/uploads/2022/02/データ-7.jpg" alt="" class="wp-image-3660" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/データ-7.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-7-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-7-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>条件分岐については<a href="https://automa-recipe.com/learn-programming/three-factors/" title="iPhoneショートカットの「スクリプティング」とは？プログラミングの基本3要素を理解しよう！">【iOSショートカットで学ぶ！プログラミング教室】第２回の記事</a>でも説明しましたが、復習もかねて説明していきます。</p>



<p><strong><span class="swl-marker mark_yellow">「条件分岐」というのは、設定した特定の条件によって実行するプログラム（アクション）を変更すること</span></strong>です。</p>



<p><span class="swl-marker mark_orange">条件によって実行するアクションを分岐するから、条件分岐</span>と呼びます。</p>



<p>「もし〇〇だったら、〜〜する」<br>「もし××が&#8212;の時は、△△する」</p>



<p>これが条件分岐の基本になります。</p>



<p>ショートカットを作っているときに、特定の条件でアクションを使い分けたい時はよくありますよね。</p>



<p>例えば、<br><strong>・Bluetoothがオンのときはイヤホンを自動接続<br>→Bluetoothがオフのときは「Bluetoothがオフです」とテキストを表示</strong><br>というような時ですね。</p>



<p>以上のような条件分岐を可能にするために、<span class="swl-marker mark_orange">iOSショートカットには<strong>条件分岐をするためのアクション</strong>が用意されているのです。</span></p>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5725212284208116"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5725212284208116"
     data-ad-slot="2014468485"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h2 class="wp-block-heading" id="条件分岐で使う２つのアクション">条件分岐で使う２つのアクション</h2>



<figure class="wp-block-image size-full"><img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/uploads/2022/02/データ-8.jpg" alt="" class="wp-image-3661" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/データ-8.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-8-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-8-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>条件分岐を可能にするためのアクションを２つ紹介します。</p>



<p>ここで各々の特徴を理解していただいて、実践編に挑戦して欲しいです。</p>



<h3 class="wp-block-heading" id="if文画像まずは-if文-アクションです">１つ目のアクション：if文</h3>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/1.jpeg" alt="" class="wp-image-3623" width="415" height="136" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/1.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/1-300x98.jpeg 300w" sizes="(max-width: 415px) 100vw, 415px" /></figure></div>



<p id="if文画像まずは-if文-アクションです">まずは「if文」アクションです。</p>



<p>以下が「if文」アクション追加後の初期状態です。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/2-1.jpeg" alt="" class="wp-image-3625" width="335" height="250" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/2-1.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/2-1-300x224.jpeg 300w" sizes="(max-width: 335px) 100vw, 335px" /></figure></div>



<p>ここで公式の「if文」についての説明を見てみましょう。</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p><span class="swl-marker mark_yellow">条件が真</span>かどうか<span class="swl-marker mark_blue">テスト</span>し、真の場合は内部のアクションを実行します。</p><p><span class="swl-marker mark_green">真でない場合</span>は”その他の場合”の下のアクションが実行されます。</p></blockquote>



<p>「条件が真」は<span class="swl-marker mark_yellow">「設定した条件と合致している（正しい、true）」</span><br>「条件が真でない」は<span class="swl-marker mark_green">「設定した条件と合致していない（誤っている、false）」</span><br>「テスト」は<span class="swl-marker mark_blue">「判断すること」</span></p>



<p>なので、公式の説明を分かりやすくすると、</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p><strong>設定した条件と一致しているか判断し、もし条件と合致している場合は内部のアクションを実行する。</strong></p><p><strong>もし設定した条件と合致していない場合は”その他の場合”の下のアクションが実行される。</strong></p></blockquote>



<p>というようになります。</p>



<p>ここまでの内容でif文の基本は十分ですが、ここで<strong>押さえておいてほしい特徴</strong>があります。</p>



<p>それは<strong><span class="swl-marker mark_orange">「if文の中にif文を入れることができる」</span></strong>ということです。</p>



<p>以下が「if文の中にif文を入れた」状態です。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/3.jpeg" alt="" class="wp-image-3626" width="342" height="429" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/3.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/3-239x300.jpeg 239w" sizes="(max-width: 342px) 100vw, 342px" /></figure></div>



<p>状況が少し分かりづらいので、図にしてみました。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/4.png" alt="" class="wp-image-3627" width="705" height="396" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/4.png 960w, https://automa-recipe.com/wp-content/uploads/2022/02/4-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/4-768x432.png 768w" sizes="(max-width: 705px) 100vw, 705px" /></figure></div>



<p><span class="swl-marker mark_yellow">この「if文をif文の中に入れること」を<strong>「ネスト」</strong>と言います。</span></p>



<p>「ネスト」の上限回数は決められていないので、何度もif文の中にif文を入れることができます。</p>



<p>ただ、<span class="swl-marker mark_orange">「ネスト」しすぎるとプログラムが読みにくくなってしまうので注意</span>です。</p>



<h3 class="wp-block-heading" id="２つ目-メニューから選択">２つ目：メニューから選択</h3>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/5.jpeg" alt="" class="wp-image-3628" width="351" height="121" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/5.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/5-300x103.jpeg 300w" sizes="(max-width: 351px) 100vw, 351px" /></figure></div>



<p>続いて<strong>「メニューから選択」</strong>アクションです。</p>



<p>以下が「メニューから選択」アクション追加後の初期状態です。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/6-594x1024.jpeg" alt="" class="wp-image-3629" width="248" height="428" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/6-594x1024.jpeg 594w, https://automa-recipe.com/wp-content/uploads/2022/02/6-174x300.jpeg 174w, https://automa-recipe.com/wp-content/uploads/2022/02/6.jpeg 719w" sizes="(max-width: 248px) 100vw, 248px" /></figure></div>







<p>このまま実行してみると、以下のようになります。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/7.jpeg" alt="" class="wp-image-3630" width="306" height="214" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/7.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/7-300x210.jpeg 300w" sizes="(max-width: 306px) 100vw, 306px" /></figure></div>



<p>「メニューから選択」アクションではその名の通り、<br><span class="swl-marker mark_yellow">ショートカット実行時に設定したメニューを出し、選ばれた項目によって特定のアクションを実行できます。</span></p>



<p>すなわち、<strong>メニューから選択してアクションを”条件分岐”できる</strong>わけです。</p>



<p><strong>「if文とは何が違うの？」</strong>と思われるかもしれません。</p>



<p>「メニューから選択」アクションは、<br><strong>・<span class="swl-marker mark_orange">条件がif文より細かく設定できない</span><br>・<span class="swl-marker mark_orange">多くの条件を設定するときに、プログラムが読みやすい</span></strong><br>という点で「if文」と異なります。</p>



<h4 class="wp-block-heading" id="条件がif文より細かく設定できない-メニューから選択-はあくまで-メニュー内の項目がタップされたとき-という条件しか持つことができません">if文との違い１つ目：条件がif文より細かく設定できない</h4>



<p id="条件がif文より細かく設定できない-メニューから選択-はあくまで-メニュー内の項目がタップされたとき-という条件しか持つことができません"><span class="swl-marker mark_yellow">「メニューから選択」はあくまで「メニュー内の項目がタップされたとき」という条件しか持つことができません。</span></p>



<p>また、if文は自動で条件分岐できますが、<br><span class="swl-marker mark_orange">「メニューから選択」は、あくまで手動での条件分岐しかできません。</span></p>



<p>つまり、<strong>if文では自動で「Bluetoothの状態を取得し、オンかオフか判定する」ということができましたが、そのようなことが「メニューから選択」ではできない</strong>ということです。</p>



<h4 class="wp-block-heading" id="if文との違い２つ目-多くの条件を設定するときに-プログラムが読みやすい">if文との違い２つ目：多くの条件を設定するときに、プログラムが読みやすい</h4>



<p>if文は<strong>「ネスト」</strong>すれば複数の条件でアクションを分岐させることが可能です。</p>



<p>しかし、すでに述べたように<span class="swl-marker mark_orange">ネストしてしまうと、プログラムが非常に読みづらくなってしまいます。</span></p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/8.jpeg" alt="" class="wp-image-3631" width="271" height="340" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/8.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/8-239x300.jpeg 239w" sizes="(max-width: 271px) 100vw, 271px" /><figcaption>２つのif文で<br>３つのアクションに条件分岐を行った場合</figcaption></figure></div>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/9-727x1024.jpeg" alt="" class="wp-image-3632" width="259" height="365" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/9-727x1024.jpeg 727w, https://automa-recipe.com/wp-content/uploads/2022/02/9-213x300.jpeg 213w, https://automa-recipe.com/wp-content/uploads/2022/02/9.jpeg 750w" sizes="(max-width: 259px) 100vw, 259px" /><figcaption>メニューから選択で<br>３つのアクションに条件分岐を行った場合</figcaption></figure></div>







<p><strong>「メニューから選択」を使った方がプログラムが見やすく、直感的に作業できる</strong>のが分かると思います。</p>



<p>ただ、先ほど述べたように<span class="swl-marker mark_orange">「メニューから選択」はif文のように細かい設定の条件分岐はできません。</span></p>



<p>「if文」と「メニューから選択」の違いを理解し、上手く使い分けることが重要です。</p>



<p>ここまで条件分岐をするためのアクションを解説してきました。</p>



<p>もしかすると理解できない部分もあったかもしれません。</p>



<p>ただ、「習うより慣れろ」と言いますから、<br>早速実践でショートカットを作って理解を深めましょう！</p>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5725212284208116"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5725212284208116"
     data-ad-slot="2014468485"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h2 class="wp-block-heading" id="実践編1-現在地の天気が雨か判定するショートカット">【実践編1】現在地の天気が雨か判定するショートカット</h2>



<p>まずは、<strong>「if文」</strong>を使って<strong>現在地の天気が雨かどうか判定し表示してくれるショートカット</strong>を作ってみましょう。</p>



<p>アクションの大まかな流れは以下の通りです。</p>



<p class="is-style-sticky_box">1.「天気アプリ」で現在地の天気を取得<br>2.「if文」で条件分岐<br>3. 雨の時は「傘を持っていって！」と表示<br>4. その他の時（晴れや曇りなど）は「傘は入りません」と表示</p>



<p>では、作っていきましょう！</p>



<p>① 新規ショートカットの作成画面から「アクションを追加」を選択し、検索欄に「現在の天気を取得」と入力し追加します。すると自動で「”現在地”の天気を取得」アクションが追加されます。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/10.jpeg" alt="" class="wp-image-3633" width="277" height="223" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/10.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/10-300x241.jpeg 300w" sizes="(max-width: 277px) 100vw, 277px" /></figure></div>







<p>② 検索欄に「if文」と入力し「if文」アクションを追加します。<br>以下の画像と同じ状態になればOKです。<br></p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/11.jpeg" alt="" class="wp-image-3634" width="286" height="312" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/11.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/11-275x300.jpeg 275w" sizes="(max-width: 286px) 100vw, 286px" /></figure></div>







<p>③ if文アクションの「もし気象状況が”条件”ならば」の「気象情報」をタップします。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/12-594x1024.jpeg" alt="" class="wp-image-3635" width="281" height="485" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/12-594x1024.jpeg 594w, https://automa-recipe.com/wp-content/uploads/2022/02/12-174x300.jpeg 174w, https://automa-recipe.com/wp-content/uploads/2022/02/12.jpeg 719w" sizes="(max-width: 281px) 100vw, 281px" /></figure></div>







<p>④「種類」という項目をタップします。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/13-594x1024.jpeg" alt="" class="wp-image-3636" width="276" height="476" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/13-594x1024.jpeg 594w, https://automa-recipe.com/wp-content/uploads/2022/02/13-174x300.jpeg 174w, https://automa-recipe.com/wp-content/uploads/2022/02/13.jpeg 719w" sizes="(max-width: 276px) 100vw, 276px" /></figure></div>







<p>⑤ 下にスクロールして「テキスト」の項目を選びます。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/14-594x1024.jpeg" alt="" class="wp-image-3637" width="274" height="473" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/14-594x1024.jpeg 594w, https://automa-recipe.com/wp-content/uploads/2022/02/14-174x300.jpeg 174w, https://automa-recipe.com/wp-content/uploads/2022/02/14.jpeg 719w" sizes="(max-width: 274px) 100vw, 274px" /></figure></div>







<p>⑥ if文アクションの「もし気象状況が”条件”ならば」の”条件”をタップし、「次を含む」を選択。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/15-1-598x1024.jpeg" alt="" class="wp-image-3639" width="271" height="464" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/15-1-598x1024.jpeg 598w, https://automa-recipe.com/wp-content/uploads/2022/02/15-1-175x300.jpeg 175w, https://automa-recipe.com/wp-content/uploads/2022/02/15-1.jpeg 724w" sizes="(max-width: 271px) 100vw, 271px" /></figure></div>



<p>⑦ if文アクションの「もし気象状況が次を含む”テキスト”ならば」の”テキスト”部分に”雨”と入力。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/16.jpeg" alt="" class="wp-image-3640" width="263" height="222" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/16.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/16-300x253.jpeg 300w" sizes="(max-width: 263px) 100vw, 263px" /></figure></div>







<p>⑧「アラートを表示」アクションを二つ追加して、「もし気象状況が次を含む”雨”ならば」の下と「その他の場合」の下に配置。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/16-1.jpeg" alt="" class="wp-image-3641" width="260" height="219" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/16-1.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/16-1-300x253.jpeg 300w" sizes="(max-width: 260px) 100vw, 260px" /></figure></div>







<p>⑨ 一つ目のアラートの内容を”傘を持っていって！”、二つ目のアラートの内容を”傘はいらないよ”と入力する。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/17-725x1024.jpeg" alt="" class="wp-image-3642" width="259" height="366" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/17-725x1024.jpeg 725w, https://automa-recipe.com/wp-content/uploads/2022/02/17-212x300.jpeg 212w, https://automa-recipe.com/wp-content/uploads/2022/02/17.jpeg 750w" sizes="(max-width: 259px) 100vw, 259px" /></figure></div>



<p>これで作成完了です！</p>



<p>if文を使ったショートカットを作成することができました！</p>



<p><span class="swl-marker mark_orange">ポイントは、④〜⑦です！</span></p>



<p><span class="swl-marker mark_yellow">初期設定されている、<strong>「もし〇〇が××ならば」の〇〇の部分の種類を変更しないと、<br><span class="swl-marker mark_yellow">××</span>の箇所に設定できる条件が「任意の値（値がある）」「値がない」という2択に</strong>なってしまいます。</span></p>



<p>これだと、天気が「雨」かどうかの判別ができません。</p>



<p>そこで、〇〇の箇所の種類をテキストにして、それが「”雨”というテキストを含むかどうか」でif文を作ったわけです。</p>



<p><span class="swl-marker mark_orange">「もし〇〇が××ならば」の〇〇の部分の種類を変更することで、××の箇所で様々な条件が使えるようになります</span>ので、ぜひ色々と試してみてください！</p>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5725212284208116"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5725212284208116"
     data-ad-slot="2014468485"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h2 class="wp-block-heading" id="実践編2-メニュー選択で電話をかけるショートカット">【実践編2】メニュー選択で電話をかけるショートカット</h2>



<p>続いて、<strong>「メニューから選択</strong>」アクションを使って、<strong>メニュー選択した相手に電話をかけるショートカットを作</strong>成してみましょう！</p>



<p>① 新規ショートカットの作成画面から「アクションを追加」を選択し、検索欄に「メニューから追加」と入力しアクションを追加します。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/19-594x1024.jpeg" alt="" class="wp-image-3644" width="269" height="464" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/19-594x1024.jpeg 594w, https://automa-recipe.com/wp-content/uploads/2022/02/19-174x300.jpeg 174w, https://automa-recipe.com/wp-content/uploads/2022/02/19.jpeg 719w" sizes="(max-width: 269px) 100vw, 269px" /></figure></div>







<p>② メニュー内の項目に適当な名前を入力。「新規項目を追加」を押すと、項目が増やせます。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/20-599x1024.jpeg" alt="" class="wp-image-3645" width="269" height="460" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/20-599x1024.jpeg 599w, https://automa-recipe.com/wp-content/uploads/2022/02/20-175x300.jpeg 175w, https://automa-recipe.com/wp-content/uploads/2022/02/20.jpeg 725w" sizes="(max-width: 269px) 100vw, 269px" /></figure></div>







<p>③ 「電話番号アクション」をメニューの項目の数だけ追加します。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/21-1.jpeg" alt="" class="wp-image-3648" width="272" height="344" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/21-1.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/21-1-237x300.jpeg 237w" sizes="(max-width: 272px) 100vw, 272px" /></figure></div>







<p>④ 追加した「電話番号アクション」を、メニューの各項目の下に配置する。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/22-1-594x1024.jpeg" alt="" class="wp-image-3649" width="268" height="462" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/22-1-594x1024.jpeg 594w, https://automa-recipe.com/wp-content/uploads/2022/02/22-1-174x300.jpeg 174w, https://automa-recipe.com/wp-content/uploads/2022/02/22-1.jpeg 719w" sizes="(max-width: 268px) 100vw, 268px" /></figure></div>







<p>⑤ メニューの各項目に対応する電話番号を「電話番号アクション」に入力する。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/24-608x1024.jpeg" alt="" class="wp-image-3651" width="291" height="490" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/24-608x1024.jpeg 608w, https://automa-recipe.com/wp-content/uploads/2022/02/24-178x300.jpeg 178w, https://automa-recipe.com/wp-content/uploads/2022/02/24.jpeg 736w" sizes="(max-width: 291px) 100vw, 291px" /></figure></div>







<p>⑥ 新たに「発信」アクションを追加し、「メニューの終了」の下に配置する。発信アクションが「”メニューの結果”に発信」となっていない場合は、マジック変数の選択から「メニューの結果」を選ぶ。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/23-597x1024.jpeg" alt="" class="wp-image-3650" width="279" height="479" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/23-597x1024.jpeg 597w, https://automa-recipe.com/wp-content/uploads/2022/02/23-175x300.jpeg 175w, https://automa-recipe.com/wp-content/uploads/2022/02/23.jpeg 723w" sizes="(max-width: 279px) 100vw, 279px" /></figure></div>



<p>これで作成完了です！</p>



<p>実行してみると、メニューが表れて選択した項目の電話番号に発信できると思います！</p>



<p>今回のポイントは、２点あります！</p>



<p><strong>・メニューの各項目の下のアクションが実行される（④）<br>・”メニューの結果”からメニューの各項目内の変数が参照できる（⑥）</strong></p>



<p><strong><span class="swl-marker mark_yellow">メニューの結果で何を参照するかは、「メニューの結果」をタップして「種類」という箇所から変更できます</span></strong>ので参考までに！</p>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5725212284208116"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5725212284208116"
     data-ad-slot="2014468485"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h2 class="wp-block-heading" id="終わりに">終わりに</h2>



<figure class="wp-block-image size-full"><img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/uploads/2022/02/データ-9.jpg" alt="" class="wp-image-3662" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/データ-9.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-9-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-9-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>「iOSショートカットで学ぶ！プログラミング教室」第４回となった本記事では、以下の２点について詳しく解説しました。</p>



<ul class="is-style-check_list wp-block-list"><li><strong>条件分岐とは何か</strong></li><li><strong>「if文」「メニューから選択」アクションの使い方</strong></li></ul>



<p>実践でショートカットを２つも作成したこともあり、かなりボリューミーな内容だったと思います。<br>本当にお疲れ様でした。</p>



<p>おそらく、条件分岐のやり方はかなり理解できたのではないでしょうか？</p>



<p>もし理解できないところがあれば、本記事やこれまでの記事を復習しつつ、色々とショートカットを自分で作ると勉強になると思います！</p>



<p>最後までお読みいただきありがとうございました！</p>



<p>次回の記事は<a href="https://automa-recipe.com/learn-programming/how-repeat/" title="「繰り返す」や「リスト」をiPhoneショートカットで使いこなそう！">こちら！</a></p>


<div class="swell-block-postLink" data-style="card">			<a href="https://automa-recipe.com/learn-programming/how-repeat/" class="p-blogCard -internal" data-type="type3">
			<div class="p-blogCard__inner">
				<span class="p-blogCard__caption">あわせて読みたい</span>
				<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-300x169.jpg" alt="" class="c-postThumb__img -no-lb"></figure></div>				<div class="p-blogCard__body">
					<span class="p-blogCard__title">「繰り返す」や「リスト」をiPhoneショートカットで使いこなそう！</span>
					<span class="p-blogCard__excerpt">「繰り返す」「リスト」といったアクションは、「便利そうだけど、使い方がよく分からない…」と思っている方が多いと思います。 しかし、実際には難しいことはなく、正&#8230;</span>				</div>
			</div></a>
		</div>


<h4 class="wp-block-heading" id="プログラミング教室の記事一覧">プログラミング教室の記事一覧</h4>


<div class="p-postListWrap  "><ul class="p-postList -type-list"><li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/how-to-earn/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【経験談あり】プログラミングの基礎を理解した後、副業で稼ぐ３つの方法を解説！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-06">2022.02.06</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/difference-proggraming/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【超簡単】iPhoneの「ショートカット」アプリでプログラミング学習を始めよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-01-30">2022.01.30</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/three-factors/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">iPhoneショートカットの「スクリプティング」とは？プログラミングの基本3要素を理解しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-01">2022.02.01</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/what-is-variable/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【徹底解説！】「変数」って何？iPhoneショートカットを作りながらマスターしよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-03">2022.02.03</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/how-use-if/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【if文をマスターする！】iPhoneショートカットで条件分岐を完全理解しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-04">2022.02.04</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/how-repeat/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">「繰り返す」や「リスト」をiPhoneショートカットで使いこなそう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-05">2022.02.05</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/iphone-javascript/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">「JavaScript」とは？iPhoneショートカットで実行する方法を徹底解説！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-06">2022.02.06</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/javascript-variable-list/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">JavaScriptで「変数」と「配列」を扱う方法を学習しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-09">2022.02.09</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/javascript-if-for/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">「条件分岐」「繰り返し」をJavaScriptで行う方法を理解しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-11">2022.02.11</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/webapi-dict/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">Web APIって何？iPhoneショートカットで活用する方法！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-13">2022.02.13</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/shortcuts-webapi-practice/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">実践！iPhoneショートカットでWeb APIを使いこなそう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-19">2022.02.19</time>
		</div>
				</div>
			</div>
			</a>
</li>
</ul></div><p>The post <a href="https://automa-recipe.com/learn-programming/how-use-if/">【if文をマスターする！】iPhoneショートカットで条件分岐を完全理解しよう！</a> first appeared on <a href="https://automa-recipe.com">オートクック！</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://automa-recipe.com/learn-programming/how-use-if/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>【徹底解説！】「変数」って何？iPhoneショートカットを作りながらマスターしよう！</title>
		<link>https://automa-recipe.com/learn-programming/what-is-variable/</link>
					<comments>https://automa-recipe.com/learn-programming/what-is-variable/#comments</comments>
		
		<dc:creator><![CDATA[automa-recipe]]></dc:creator>
		<pubDate>Thu, 03 Feb 2022 10:29:55 +0000</pubDate>
				<category><![CDATA[プログラミング教室]]></category>
		<category><![CDATA[まとめ]]></category>
		<guid isPermaLink="false">https://automa-recipe.com/?p=3589</guid>

					<description><![CDATA[<p><img src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー.jpg" class="webfeedsFeaturedVisual" /></p><p>iOSショートカットの作成において、「変数」は非常に重要です。 「変数」を制すものがショートカットを制す、と言っても過言ではないでしょう。 しかし、ショートカットを作成しているときも「変数」という言葉は頻繁に出てきますが [&#8230;]</p>
<p>The post <a href="https://automa-recipe.com/learn-programming/what-is-variable/">【徹底解説！】「変数」って何？iPhoneショートカットを作りながらマスターしよう！</a> first appeared on <a href="https://automa-recipe.com">オートクック！</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><img src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー.jpg" class="webfeedsFeaturedVisual" /></p><p>iOSショートカットの作成において、<strong>「変数」</strong>は非常に重要です。</p>



<p><span class="swl-marker mark_yellow">「変数」を制すものがショートカットを制す</span>、と言っても過言ではないでしょう。</p>



<p>しかし、<br>ショートカットを作成しているときも「変数」という言葉は頻繁に出てきますが、<span class="swl-marker mark_orange">実際に変数がどういったものかを理解し活用できている人は少ない</span>と思います。</p>



<p>そこで今回の記事では、</p>



<ul class="is-style-check_list wp-block-list"><li>変数とは何か？</li><li>iOSショートカットで使う２つの変数</li></ul>



<p>という２点について、解説していきます！</p>



<p>これまで<strong>「<a href="https://automa-recipe.com/programming_articles/" title="【iOSショートカットで学ぶ】プログラミング教室">iOSショートカットで学ぶ！プログラミング教室</a>」</strong>シリーズの第１回と第２回で、ショートカットとプログラミングの関係や、プログラミングの基本3要素について学習してきました。</p>


<div class="swell-block-postLink" data-style="card">			<a href="https://automa-recipe.com/learn-programming/difference-proggraming/" class="p-blogCard -internal" data-type="type3">
			<div class="p-blogCard__inner">
				<span class="p-blogCard__caption">あわせて読みたい</span>
				<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5-300x169.jpg" alt="" class="c-postThumb__img -no-lb"></figure></div>				<div class="p-blogCard__body">
					<span class="p-blogCard__title">【超簡単】iPhoneの「ショートカット」アプリでプログラミング学習を始めよう！</span>
					<span class="p-blogCard__excerpt">みなさん、iOSの「ショートカット」アプリ使ってますか？ iPhoneやiPadだけでなく、Macでもショートカットアプリが使えるようになり、自動化・効率化に大活躍ですね。 &#8230;</span>				</div>
			</div></a>
		</div>

<div class="swell-block-postLink" data-style="card">			<a href="https://automa-recipe.com/learn-programming/three-factors/" class="p-blogCard -internal" data-type="type3">
			<div class="p-blogCard__inner">
				<span class="p-blogCard__caption">あわせて読みたい</span>
				<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー-300x169.jpg" alt="" class="c-postThumb__img -no-lb"></figure></div>				<div class="p-blogCard__body">
					<span class="p-blogCard__title">iPhoneショートカットの「スクリプティング」とは？プログラミングの基本3要素を理解しよう！</span>
					<span class="p-blogCard__excerpt">iOSショートカットを作成する時に、アクションの追加画面には「スクリプティング」項目が出てきますよね。ショートカットを作ったことがある方なら、一度は見たことがあ&#8230;</span>				</div>
			</div></a>
		</div>


<p>「<strong>変数」はプログラミングするときには絶対に必要な存在</strong>ですので、第３回となる今回は<span class="swl-marker mark_yellow">「ショートカット作り」「プログラミング学習」という２点において、特に非常に重要な回となります。</span></p>



<p>プログラミング初学者の方でも分かりやすいよう具体例を用いて解説していきますので、もし１度目で理解できなかったとしても、本記事を何度も読み返して理解していただきたいです。</p>



<p>それでは、Let’s プログラミング！</p>



<div class="swell-toc-placeholder"></div>



<h2 class="wp-block-heading" id="そもそも変数って何">そもそも変数って何?</h2>



<figure class="wp-block-image size-full"><img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/uploads/2022/02/データ-5.png" alt="" class="wp-image-3614" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/データ-5.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-5-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-5-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>まず、<strong>「変数」</strong>とは何かを説明します。</p>



<p>簡潔に言うと、<strong><span class="swl-marker mark_orange">変数</span></strong><span class="swl-marker mark_orange">とは</span><strong><span class="swl-marker mark_orange">「データを入れるための箱」</span></strong>のことです。</p>



<p><span class="swl-marker mark_yellow">変数は</span>、”1”などの数値から”山田”というような文字列まで<span class="swl-marker mark_yellow">様々な値を入れることができ、その箱に好きな名前を付けることができます。</span></p>



<p>ここで一つ例を考えてみましょう。<br>”山田”という文字（データ）を入れた “母の旧姓”という名前の変数を作ってみます。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/データ-1.png" alt="" class="wp-image-3590" width="490" height="275" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/データ-1.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-1-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-1-768x432.png 768w" sizes="(max-width: 490px) 100vw, 490px" /></figure></div>



<p><br>“母の旧姓”という名前の箱を用意しておけば、いつでも”山田”というデータを取り出すことができます。</p>



<p><span class="swl-marker mark_yellow">変数がデータを入れるための箱である</span>というイメージは湧きましたでしょうか？</p>



<p>さらに、<strong><span class="swl-marker mark_orange">一般的に変数は「１つの変数には１つのデータしか入れることができない」</span></strong>ということも理解しておきましょう。</p>



<p>先程の例で言うと、”母の旧姓”と言う名前の箱（変数）に”山田”以外のデータ（例えば”鈴木”や”佐藤”）を追加で入れることができません。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/データ-2.png" alt="" class="wp-image-3591" width="490" height="275" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/データ-2.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-2-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-2-768x432.png 768w" sizes="(max-width: 490px) 100vw, 490px" /></figure></div>



<p>このように１つの変数には１つのデータしか入れられないという決まりがあるのですが、実は<strong>変数の中に入っているデータを入れ替えることができます。</strong></p>



<p>例えば、<br>“母の旧姓”という箱（変数）に”鈴木”という新たなデータを入れようとしたとき、”山田”という古いデータは箱の外に追い出し、”山田”の代わりに”鈴木”というデータを”母の旧姓”という変数に入れることができます。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/データ-3.png" alt="" class="wp-image-3592" width="460" height="258" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/データ-3.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-3-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-3-768x432.png 768w" sizes="(max-width: 460px) 100vw, 460px" /></figure></div>



<p>以上の点を押さえておけば、変数の基本はOKです。</p>



<p><span class="swl-marker mark_yellow">ただ、注意すべきは、<strong>ショートカットには扱う変数が３種類もある</strong>ということです。</span></p>



<p>続いて、iOSショートカットで使う３つの変数について理解しましょう。</p>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5725212284208116"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5725212284208116"
     data-ad-slot="2014468485"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h2 class="wp-block-heading" id="iosショートカットで使う３つの変数">iOSショートカットで使う３つの変数</h2>



<figure class="wp-block-image size-full"><img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/uploads/2022/02/データ-6.jpg" alt="" class="wp-image-3615" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/データ-6.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-6-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/データ-6-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>ショートカットで扱う変数には、<strong>「マジック変数」「特殊変数」「手動変数」の</strong>３つが存在します。</p>



<p>この３つの違いを理解し、使い分けれるようになるとショートカットでできることが格段に増えます。</p>



<p>また、先に言っておくと、<span class="swl-marker mark_orange">これまで説明してきた「変数」とショートカットにおける「変数」は違う性質を持っていたりするので、要注意</span>です。</p>



<p>それでは、ひとつずつ理解していきましょう。</p>



<h3 class="wp-block-heading" id="１つ目の変数-マジック変数とは">１つ目の変数：マジック変数とは？</h3>



<p><span class="swl-marker mark_orange"><strong>マジック変数は、各アクションの出力結果（データ）を自動で変数として格納して</strong></span>くれます。</p>



<p>以下は、メモを検索しQuickLookで表示するショートカットの作成画面です。<br>今、「メモを検索」アクションと「Quick Lookで表示」アクションが配置されています。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/IMG_6576C22F8055-1.jpeg" alt="" class="wp-image-3594" width="286" height="259" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/IMG_6576C22F8055-1.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/IMG_6576C22F8055-1-300x272.jpeg 300w" sizes="(max-width: 286px) 100vw, 286px" /></figure></div>







<p>「Quick Lookで表示」アクションの「入力」という箇所が空白になっていますのでタップし、「マジック変数を入力」をタップしてみます。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/IMG_9FA323A8B35B-1-1-594x1024.jpeg" alt="" class="wp-image-3596" width="285" height="492" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/IMG_9FA323A8B35B-1-1-594x1024.jpeg 594w, https://automa-recipe.com/wp-content/uploads/2022/02/IMG_9FA323A8B35B-1-1-174x300.jpeg 174w, https://automa-recipe.com/wp-content/uploads/2022/02/IMG_9FA323A8B35B-1-1.jpeg 719w" sizes="(max-width: 285px) 100vw, 285px" /></figure></div>



<p>すると、以下のように「メモを検索」アクションの下に「ノート」という項目が出てきます。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/IMG_5B6571802293-1.jpeg" alt="" class="wp-image-3597" width="284" height="357" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/IMG_5B6571802293-1.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/IMG_5B6571802293-1-239x300.jpeg 239w" sizes="(max-width: 284px) 100vw, 284px" /></figure></div>







<p>これがマジック変数で、メモを検索した結果のデータを自動で「ノート」という名前の変数に入れてくれているのです。</p>



<p>普通は、<br><strong>・変数（箱）を用意し、データを箱に入れる<br>・変数（箱）からデータを出す。<br>という流れでデータを扱う</strong>のですが、</p>



<p>iOSショートカットでは、<span class="swl-marker mark_yellow">アクションの結果（データ）を入れる変数（箱）は自動で「マジック変数」として用意してくれて、それを使って簡単にデータを取り出すことができます。</span></p>



<p><strong>自分で変数を用意しなくても直感的にデータを操れるので、めちゃくちゃ便利</strong>です。<br>まさに「マジック」ですね。</p>



<h3 class="wp-block-heading" id="２つ目の変数-手動変数とは">２つ目の変数：手動変数とは？</h3>



<p><strong><span class="swl-marker mark_orange">手動変数は、その名の通り自分で設定する変数のこと</span></strong>です。</p>



<p>マジック変数は、アクションの結果を自動で変数に設定してくれました。</p>



<p>そこを自分で（手動で）設定するのが手動変数です。</p>



<p>先ほどのメモを検索しQuickLookで表示するショートカットを手動変数を使って作ると以下のようになります。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/IMG_D2E78C97BD60-1.jpeg" alt="" class="wp-image-3599" width="243" height="306" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/IMG_D2E78C97BD60-1.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/IMG_D2E78C97BD60-1-239x300.jpeg 239w" sizes="(max-width: 243px) 100vw, 243px" /></figure></div>



<p><strong>「変数を設定」</strong>というアクションを追加しメモを検索した結果（データ）を<strong>「メモ」という名前の変数（箱）</strong>に入れ、クイックルックアクション内で「メモ」という名前の変数（箱）からメモを検索した結果（データ）を取り出し、表示する。</p>



<p>以上のようなことをしているわけですが、マジック変数を使った方が簡単だと思いませんでしたか？</p>



<p><span class="swl-marker mark_orange">多くの場合、手動変数を使わずにマジック変数を使った方が良いです。</span></p>



<p>マジック変数を使った方がプログラムが読みやすくなりますし、なりより便利であるからです。</p>



<p>しかし、<span class="swl-marker mark_yellow">手動変数にはマジック変数にできないこと</span>があります。</p>



<p>それは<strong><span class="swl-marker mark_yellow">「複数のデータを入れておく」こと</span></strong>です。</p>



<p>「え？前に<strong>”1つの変数には1つのデータしか入らない”</strong>って言ってなかった？」<br>と思った方は鋭いです。</p>



<p><span class="swl-marker mark_orange">実は、ショートカットの手動変数というのは特別で、複数の値を入れることができるのです。</span></p>



<p>ショートカットの手動変数に複数の値を入れるには<strong>「変数に追加」</strong>というアクションを使います。</p>



<p>「メモを検索してクイックルックで表示するショートカット」で「変数に追加」を使ってみると以下のようになります。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/IMG_70605BC8683A-1-594x1024.jpeg" alt="" class="wp-image-3601" width="235" height="404" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/IMG_70605BC8683A-1-594x1024.jpeg 594w, https://automa-recipe.com/wp-content/uploads/2022/02/IMG_70605BC8683A-1-174x300.jpeg 174w, https://automa-recipe.com/wp-content/uploads/2022/02/IMG_70605BC8683A-1.jpeg 719w" sizes="(max-width: 235px) 100vw, 235px" /></figure></div>



<p>まずは、①”本日の予定”という文字を本文に含むメモを検索し、</p>



<p>②その結果を「変数に設定」アクションを使って「メモ」という名前の変数に入れています。</p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/IMG_1A01D4ECBEB8-1-2-597x1024.jpeg" alt="" class="wp-image-3600" width="204" height="350" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/IMG_1A01D4ECBEB8-1-2-597x1024.jpeg 597w, https://automa-recipe.com/wp-content/uploads/2022/02/IMG_1A01D4ECBEB8-1-2-175x300.jpeg 175w, https://automa-recipe.com/wp-content/uploads/2022/02/IMG_1A01D4ECBEB8-1-2.jpeg 723w" sizes="(max-width: 204px) 100vw, 204px" /></figure></div>



<p>続いて、③”auto-cook”という文字を本文に含むメモを検索しています。</p>



<p>その下に④「変数に追加」アクションを追加し、③の検索結果を事前に設定しておいた「メモ」という名前の変数に追加しています。</p>



<p>そして最後に、⑤「”本日の予定”という文字を本文に含むメモ」「”auto-cook”という文字を本文に含むメモ」という２つのデータが入った「メモ」という変数から、クイックルックで中にある２つのデータを表示しています。</p>



<p>これは、マジック変数ではできないことです。<br><span class="swl-marker mark_orange">手動変数をうまく使えば、複数のデータを使ったショートカットを作成することが可能になります。</span></p>



<p><span class="swl-marker mark_yellow">ただ、一般的な定義では、変数というのは１つにつき１データです。</span></p>



<p>ですので、もしショートカットアプリ以外（JavaScriptなどのプログラミング言語などを用いて）でプログラミングをすることになったときに、</p>



<p><strong>「変数って複数の値を格納できるんでしょ？」</strong>と思っていると困ったことになってしまうので注意です。</p>



<p>ショートカットの変数が例外的であることを意識しておきましょう。</p>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5725212284208116"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5725212284208116"
     data-ad-slot="2014468485"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h3 class="wp-block-heading" id="２つ目の変数-特殊変数とは">２つ目の変数：特殊変数とは？</h3>



<p>最後に、<strong>特殊変数</strong>です。</p>



<p><strong><span class="swl-marker mark_yellow">特殊変数とは、ショートカットが実行されるごとに異なるデータが格納される変数のことです。</span></strong></p>



<p>現段階では意味不明だと思いますが、特殊変数の具体例を見れば「あー、あれか！」と理解できると思います。</p>



<p>特殊変数には以下のようなものがあります。<br><strong>・毎回尋ねる<br>・クリップボード<br>・現在の日付<br>・ショートカットの入力</strong><br>などです。</p>



<p>クリップボードの中身や現在の日付というのは、ショートカットを実行する時々で変化しますよね？</p>



<p>「毎回尋ねる」というのも、ショートカットの実行時に毎回入力を求めてくるものなので、その都度値が変化します。</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/IMG_DE5839CA7BD1-1.jpeg" alt="" class="wp-image-3602" width="282" height="160" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/IMG_DE5839CA7BD1-1.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/IMG_DE5839CA7BD1-1-300x170.jpeg 300w" sizes="(max-width: 282px) 100vw, 282px" /></figure></div>



<p>↓ 実行画面</p>



<div class="wp-block-image"><figure class="alignleft size-full is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/IMG_BA78A41EC615-1.jpeg" alt="" class="wp-image-3603" width="279" height="191" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/IMG_BA78A41EC615-1.jpeg 750w, https://automa-recipe.com/wp-content/uploads/2022/02/IMG_BA78A41EC615-1-300x206.jpeg 300w" sizes="(max-width: 279px) 100vw, 279px" /></figure></div>







<p>これらの特殊変数は、事前に用意されています。</p>



<p><span class="swl-marker mark_yellow">変数の選択画面や、キーボード入力の上から選ぶことができます。</span></p>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/IMG_59702E69935A-1-1-594x1024.jpeg" alt="" class="wp-image-3605" width="217" height="372"/></figure></div>



<div class="wp-block-image"><figure class="alignleft size-large is-resized"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/IMG_04FECF3A6D2E-1-594x1024.jpeg" alt="" class="wp-image-3607" width="215" height="371" srcset="https://automa-recipe.com/wp-content/uploads/2022/02/IMG_04FECF3A6D2E-1-594x1024.jpeg 594w, https://automa-recipe.com/wp-content/uploads/2022/02/IMG_04FECF3A6D2E-1-174x300.jpeg 174w, https://automa-recipe.com/wp-content/uploads/2022/02/IMG_04FECF3A6D2E-1.jpeg 719w" sizes="(max-width: 215px) 100vw, 215px" /></figure></div>



<p>この特殊変数も、マジック変数と同様に自動で設定してくれるので非常に使いやすいですね。</p>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5725212284208116"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5725212284208116"
     data-ad-slot="2014468485"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h2 class="wp-block-heading" id="まとめ">まとめ</h2>



<p>ここまで<br><strong>・変数の基本的な概念<br>・ショートカットで使う３つの変数</strong><br>について解説してきました。</p>



<p>おそらく、「変数、変数、言われすぎて、よく分からくなった…」という方もいらっしゃると思いますので、</p>



<p><span class="swl-marker mark_yellow">ここまでの内容をまとめたチェックシート</span>を作っておきます。<br>復習にご活用ください！</p>



<p class="is-style-big_icon_check"><strong>・変数は「データを入れるための箱」<br><br>・変数には好きな名前をつけれる<br><br>・１の変数には１つのデータしか入らない<br><br>・ショートカットアプリの変数には「マジック変数」「手動変数」「特殊変数」の３種類がある<br><br>・「マジック変数」にはアクションの結果（データ）が自動で入れられるので、自分で変数を設定しなくて良いから便利<br><br>・「手動変数」は自分で名前とデータを用意する変数。一般的な変数と違い、複数のデータを持つことができる。<br><br>・「特殊変数」はショートカットを実行する時々でデータが変わる変数。自動で用意されている。</strong></p>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5725212284208116"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5725212284208116"
     data-ad-slot="2014468485"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h2 class="wp-block-heading" id="終わりに">終わりに</h2>



<p>「iOSショートカットで学ぶ！プログラミング教室」第３回の本記事では、<strong>「変数」</strong>について解説しました。</p>



<p>プログラミングに慣れていない方だと、初見で理解することが難しかったかもしれません。</p>



<p>しかし、<span class="swl-marker mark_yellow">自分で手を動かして変数を使ってショートカットを作ってみれば、「ああ！こういうことだったのか！」と理解できることもある</span>と思います。</p>



<p>自分で「変数」を使ってみて、よく分からなくなってしまったら、またこの記事に帰ってきてください！</p>



<p>次回の記事は<a href="https://automa-recipe.com/learn-programming/how-use-if/" title="【if文をマスターする！】iPhoneショートカットで条件分岐を完全理解しよう！">こちら！</a></p>


<div class="swell-block-postLink" data-style="card">			<a href="https://automa-recipe.com/learn-programming/how-use-if/" class="p-blogCard -internal" data-type="type3">
			<div class="p-blogCard__inner">
				<span class="p-blogCard__caption">あわせて読みたい</span>
				<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-300x169.jpg" alt="" class="c-postThumb__img -no-lb"></figure></div>				<div class="p-blogCard__body">
					<span class="p-blogCard__title">【if文をマスターする！】iPhoneショートカットで条件分岐を完全理解しよう！</span>
					<span class="p-blogCard__excerpt">iOSでショートカットを作っているとき、「if文」というアクションをよく見かけると思います。 「なんだか難しそう…」と多くの方が思っていることでしょう。 しかし、慣&#8230;</span>				</div>
			</div></a>
		</div>


<h4 class="wp-block-heading" id="プログラミング教室の記事一覧">プログラミング教室の記事一覧</h4>


<div class="p-postListWrap  "><ul class="p-postList -type-list"><li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/how-to-earn/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【経験談あり】プログラミングの基礎を理解した後、副業で稼ぐ３つの方法を解説！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-06">2022.02.06</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/difference-proggraming/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/01/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法-5-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【超簡単】iPhoneの「ショートカット」アプリでプログラミング学習を始めよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-01-30">2022.01.30</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/three-factors/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">iPhoneショートカットの「スクリプティング」とは？プログラミングの基本3要素を理解しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-01">2022.02.01</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/what-is-variable/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【徹底解説！】「変数」って何？iPhoneショートカットを作りながらマスターしよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-03">2022.02.03</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/how-use-if/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">【if文をマスターする！】iPhoneショートカットで条件分岐を完全理解しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-04">2022.02.04</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/how-repeat/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー.jpg" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー.jpg 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-300x169.jpg 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-768x432.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">「繰り返す」や「リスト」をiPhoneショートカットで使いこなそう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-05">2022.02.05</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/iphone-javascript/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピー-1-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">「JavaScript」とは？iPhoneショートカットで実行する方法を徹底解説！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-06">2022.02.06</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/javascript-variable-list/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピー-2-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">JavaScriptで「変数」と「配列」を扱う方法を学習しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-09">2022.02.09</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/javascript-if-for/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピー-3-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">「条件分岐」「繰り返し」をJavaScriptで行う方法を理解しよう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-11">2022.02.11</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/webapi-dict/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピー-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">Web APIって何？iPhoneショートカットで活用する方法！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-13">2022.02.13</time>
		</div>
				</div>
			</div>
			</a>
</li>
<li class="p-postList__item">
	<a href="https://automa-recipe.com/learn-programming/shortcuts-webapi-practice/" class="p-postList__link">
		<div class="p-postList__thumb c-postThumb">
	<figure class="c-postThumb__figure">
		<img decoding="async" width="1024" height="576" src="https://automa-recipe.com/wp-content/themes/swell/assets/img/placeholder.png" data-src="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー.png" class="lazyload c-postThumb__img -no-lb wp-post-image" alt="" title="" data-srcset="https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー.png 1024w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー-300x169.png 300w, https://automa-recipe.com/wp-content/uploads/2022/02/プログラミングの基礎を理解した後、-副業で稼ぐ３つの方法のコピーのコピーのコピーのコピーのコピーのコピーのコピーのコピー-768x432.png 768w" sizes="(max-width: 1024px) 100vw, 1024px"  data-aspectratio="1024/576">	</figure>
	</div>
					<div class="p-postList__body">
				<h2 class="p-postList__title">実践！iPhoneショートカットでWeb APIを使いこなそう！</h2>								<div class="p-postList__meta">
					<div class="p-postList__times c-postTimes u-thin">
			<time class="c-postTimes__posted icon-posted" datetime="2022-02-19">2022.02.19</time>
		</div>
				</div>
			</div>
			</a>
</li>
</ul></div><p>The post <a href="https://automa-recipe.com/learn-programming/what-is-variable/">【徹底解説！】「変数」って何？iPhoneショートカットを作りながらマスターしよう！</a> first appeared on <a href="https://automa-recipe.com">オートクック！</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://automa-recipe.com/learn-programming/what-is-variable/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
