<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
	<id>https://monobook.org/w/index.php?action=history&amp;feed=atom&amp;title=Xamarin.Mac%E3%81%A7AppleScript%E3%82%92%E5%AE%9F%E8%A1%8C%E3%81%99%E3%82%8B</id>
	<title>Xamarin.MacでAppleScriptを実行する - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://monobook.org/w/index.php?action=history&amp;feed=atom&amp;title=Xamarin.Mac%E3%81%A7AppleScript%E3%82%92%E5%AE%9F%E8%A1%8C%E3%81%99%E3%82%8B"/>
	<link rel="alternate" type="text/html" href="https://monobook.org/w/index.php?title=Xamarin.Mac%E3%81%A7AppleScript%E3%82%92%E5%AE%9F%E8%A1%8C%E3%81%99%E3%82%8B&amp;action=history"/>
	<updated>2026-06-06T00:35:55Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://monobook.org/w/index.php?title=Xamarin.Mac%E3%81%A7AppleScript%E3%82%92%E5%AE%9F%E8%A1%8C%E3%81%99%E3%82%8B&amp;diff=7172&amp;oldid=prev</id>
		<title>imported&gt;Administrator: Administrator がページ「Xamarin.Mac/AppleScriptを実行する」を「Xamarin.MacでAppleScriptを実行する」に移動しました</title>
		<link rel="alternate" type="text/html" href="https://monobook.org/w/index.php?title=Xamarin.Mac%E3%81%A7AppleScript%E3%82%92%E5%AE%9F%E8%A1%8C%E3%81%99%E3%82%8B&amp;diff=7172&amp;oldid=prev"/>
		<updated>2019-05-22T05:10:57Z</updated>

		<summary type="html">&lt;p&gt;Administrator がページ「&lt;a href=&quot;/wiki/Xamarin.Mac/AppleScript%E3%82%92%E5%AE%9F%E8%A1%8C%E3%81%99%E3%82%8B&quot; class=&quot;mw-redirect&quot; title=&quot;Xamarin.Mac/AppleScriptを実行する&quot;&gt;Xamarin.Mac/AppleScriptを実行する&lt;/a&gt;」を「&lt;a href=&quot;/wiki/Xamarin.Mac%E3%81%A7AppleScript%E3%82%92%E5%AE%9F%E8%A1%8C%E3%81%99%E3%82%8B&quot; title=&quot;Xamarin.MacでAppleScriptを実行する&quot;&gt;Xamarin.MacでAppleScriptを実行する&lt;/a&gt;」に移動しました&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ja&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← 古い版&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2019年5月22日 (水) 05:10時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ja&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(相違点なし)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>imported&gt;Administrator</name></author>
	</entry>
	<entry>
		<id>https://monobook.org/w/index.php?title=Xamarin.Mac%E3%81%A7AppleScript%E3%82%92%E5%AE%9F%E8%A1%8C%E3%81%99%E3%82%8B&amp;diff=7171&amp;oldid=prev</id>
		<title>2016年3月30日 (水) 06:35にimported&gt;Administratorによる</title>
		<link rel="alternate" type="text/html" href="https://monobook.org/w/index.php?title=Xamarin.Mac%E3%81%A7AppleScript%E3%82%92%E5%AE%9F%E8%A1%8C%E3%81%99%E3%82%8B&amp;diff=7171&amp;oldid=prev"/>
		<updated>2016-03-30T06:35:56Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ja&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← 古い版&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2016年3月30日 (水) 06:35時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l48&quot;&gt;48行目:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;48行目:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==関連項目==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==関連項目==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*[[MonoMac/AppleScriptを実行する]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[MonoMac/AppleScriptを実行する]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*:[[MonoMac]]にはNSAppleScriptクラスが存在しないため別の手段を使う必要がある。&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*: [[MonoMac]]にはNSAppleScriptクラスが存在しないため別の手段を使う必要がある。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* [[Xamarin.Mac/NSTextViewでスマートクォートを無効化する]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==参考文献==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==参考文献==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>imported&gt;Administrator</name></author>
	</entry>
	<entry>
		<id>https://monobook.org/w/index.php?title=Xamarin.Mac%E3%81%A7AppleScript%E3%82%92%E5%AE%9F%E8%A1%8C%E3%81%99%E3%82%8B&amp;diff=7170&amp;oldid=prev</id>
		<title>221.188.74.218: ページの作成:「Xamarin.Macで作られたアプリの中からAppleScriptを呼び出したいことも多いだろう。 AppleScriptはMacにおいては他社製...」</title>
		<link rel="alternate" type="text/html" href="https://monobook.org/w/index.php?title=Xamarin.Mac%E3%81%A7AppleScript%E3%82%92%E5%AE%9F%E8%A1%8C%E3%81%99%E3%82%8B&amp;diff=7170&amp;oldid=prev"/>
		<updated>2015-07-02T05:24:00Z</updated>

		<summary type="html">&lt;p&gt;ページの作成:「&lt;a href=&quot;/wiki/Xamarin.Mac&quot; class=&quot;mw-redirect&quot; title=&quot;Xamarin.Mac&quot;&gt;Xamarin.Mac&lt;/a&gt;で作られた&lt;a href=&quot;/wiki/%E3%82%A2%E3%83%97%E3%83%AA&quot; title=&quot;アプリ&quot;&gt;アプリ&lt;/a&gt;の中から&lt;a href=&quot;/w/index.php?title=AppleScript&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;「AppleScript」 (存在しないページ)&quot;&gt;AppleScript&lt;/a&gt;を呼び出したいことも多いだろう。 &lt;a href=&quot;/w/index.php?title=AppleScript&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;「AppleScript」 (存在しないページ)&quot;&gt;AppleScript&lt;/a&gt;は&lt;a href=&quot;/wiki/Mac&quot; title=&quot;Mac&quot;&gt;Mac&lt;/a&gt;においては他社製...」&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Xamarin.Mac]]で作られた[[アプリ]]の中から[[AppleScript]]を呼び出したいことも多いだろう。&lt;br /&gt;
[[AppleScript]]は[[Mac]]においては他社製のアプリを起動したり制御したりする手軽な[[インターフェイス]]として重宝する。&lt;br /&gt;
&lt;br /&gt;
==実装1：NSAppleScriptクラスを使う==&lt;br /&gt;
Foundation名前空間にNSAppleScriptクラスという直球なものが存在する。&lt;br /&gt;
使い方はいたって簡単で、コンストラクタの引数にAppleScriptを渡して、ExecuteAndReturnErrorメソッドを呼ぶだけである。&lt;br /&gt;
&lt;br /&gt;
この例では[[iTunes]]を起動し再生ボタンが押された状態にする。&lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
using System;&lt;br /&gt;
&lt;br /&gt;
using AppKit;&lt;br /&gt;
using Foundation;&lt;br /&gt;
&lt;br /&gt;
namespace PlayiTunes&lt;br /&gt;
{&lt;br /&gt;
    static class MainClass&lt;br /&gt;
    {&lt;br /&gt;
        static void Main(string[] args)&lt;br /&gt;
        {&lt;br /&gt;
            // Cocoa初期化（NS〜系クラスを使うためのおまじない）&lt;br /&gt;
            NSApplication.Init();&lt;br /&gt;
&lt;br /&gt;
            // iTunesを起動し再生するAppleScript&lt;br /&gt;
            // 使い終わったら必ずDispose()すること。&lt;br /&gt;
            using (var script = new NSAppleScript(&amp;quot;tell application \&amp;quot;iTunes\&amp;quot; to play&amp;quot;))&lt;br /&gt;
            {&lt;br /&gt;
                // スクリプトを実行する&lt;br /&gt;
                var errors = new NSDictionary();&lt;br /&gt;
                var result = script.ExecuteAndReturnError(out errors);&lt;br /&gt;
&lt;br /&gt;
                if (result != null)&lt;br /&gt;
                {//たぶん正常終了&lt;br /&gt;
&lt;br /&gt;
                    // 戻り値はNSAppleEventDescriptor&lt;br /&gt;
                    Console.WriteLine(result.Description);&lt;br /&gt;
                }&lt;br /&gt;
                else&lt;br /&gt;
                {//たぶん異常終了&lt;br /&gt;
&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
            }//dispose script&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==関連項目==&lt;br /&gt;
*[[MonoMac/AppleScriptを実行する]]&lt;br /&gt;
*:[[MonoMac]]にはNSAppleScriptクラスが存在しないため別の手段を使う必要がある。&lt;br /&gt;
&lt;br /&gt;
==参考文献==&lt;br /&gt;
{{reflist}}&lt;br /&gt;
&lt;br /&gt;
{{stub}}&lt;br /&gt;
&lt;br /&gt;
[[category:Xamarin.Mac]]&lt;/div&gt;</summary>
		<author><name>221.188.74.218</name></author>
	</entry>
</feed>