<?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>脳みその中身 &#187; Howto</title>
	<atom:link href="http://bison.jp/category/howto/feed" rel="self" type="application/rss+xml" />
	<link>http://bison.jp</link>
	<description>Inside of My Brain</description>
	<lastBuildDate>Mon, 30 Jan 2012 07:49:10 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>FileMaker で Google Apps (Gmail) の PermanentLink を取得するカスタム関数</title>
		<link>http://bison.jp/cloud/796.html</link>
		<comments>http://bison.jp/cloud/796.html#comments</comments>
		<pubDate>Tue, 15 Feb 2011 08:20:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[FileMaker]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[クラウド]]></category>

		<guid isPermaLink="false">http://bison.jp/?p=796</guid>
		<description><![CDATA[自分用に、Google Apps の個々のメールの PermanentLink を取得する FileMaker の カスタム関数を作りました。 理屈は、別記事：Google Apps (Gmail) で Permanen [...]]]></description>
			<content:encoded><![CDATA[<p>自分用に、Google Apps の個々のメールの PermanentLink を取得する FileMaker の カスタム関数を作りました。</p>
<p>理屈は、別記事：<a href = "http://bison.jp/cloud/791.html">Google Apps (Gmail) で PermanentLink を取得する方法</a> の通りです。</p>
<pre>____________________
GetGmailURL ( webviewerObjectName ; shvaOption )
____________________

// Created: 2011/02/15
// by bison
//
// Parameter:
// 　webviewerObjectName : Webビューアのオブジェクト名
// 　shvaOption : 0 の場合 shvaパラメータを省略します。
// 　　1 もしくは 空値 ( "" ) の場合は ?shva=1 を付けます。
// Explanation:
// 　GMail (Google Apps) の個別メッセージURLの場合、
// 　個々のメッセージのパーマネントURL を返します。
// 　それ以外の場合、当該Webビューアで表示中のURLを返します。
/////////////////
Let (
[
$myurl = GetLayoutObjectAttribute ( webviewerObjectName ; "source" ) ;
$gmailJudgeText = "https://mail.google.com/mail/" ;
$startPos = Length ( $gmailJudgeText ) ;
$gmailFlag = Left ( $myurl ; $startPos ) = $gmailJudgeText ;
$spos = Position ( $myurl ; "/" ; 1 ; PatternCount ( $myurl ; "/" ) ) // Position of last slash
] ;

Case ( $gmailFlag ;
	Replace ( $myurl ; $startPos ; $spos - $startPos ;
	Case ( shvaOption = 0 or IsEmpty ( shvaOption ) ; "/#all" ;
	"/?shva=1/#all" ) )
	; $myurl ) // Case
)

____________________</pre>
<p>※ shvaOption については、<br />
<a href="http://googlesystem.blogspot.com/2010/07/gmails-shva-parameter.html">Gmail&#8217;s SHVA Parameter</a><br />
<a href = "http://my.opera.com/japanese/forums/topic.dml?id=277753">Gmailで日本語を検索した際の不具合</a><br />
あたりを参照してください。</p>
]]></content:encoded>
			<wfw:commentRss>http://bison.jp/cloud/796.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Apps (Gmail) で PermanentLink を取得する方法</title>
		<link>http://bison.jp/cloud/791.html</link>
		<comments>http://bison.jp/cloud/791.html#comments</comments>
		<pubDate>Tue, 15 Feb 2011 08:18:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[クラウド]]></category>

		<guid isPermaLink="false">http://bison.jp/?p=791</guid>
		<description><![CDATA[Google Apps や Gmail で個々のメッセージを表示しているときの URL の一部は、状況に応じて変化します。 受信箱にあるメッセージの場合 &#8212; #inbox ラベル経由の場合 &#8212; # [...]]]></description>
			<content:encoded><![CDATA[<p>Google Apps や Gmail で個々のメッセージを表示しているときの URL の一部は、状況に応じて変化します。</p>
<p>受信箱にあるメッセージの場合 &#8212; #inbox<br />
ラベル経由の場合 &#8212; #label<br />
検索の結果経由の場合 &#8212; #search<br />
など&#8230;</p>
<p>とは言え、受信箱内のメールをアーカイブした場合も、 受信箱にあったときと同じ URL で当該メールは表示されるようになっている<strong>はず</strong>です。<br />
<em>( 僕の記憶があっていれば、以前は、アーカイブされたメールは、受信箱にあったときの URL では表示できなかったと思いますが、いつからか、仕様が変わったようです ) </em></p>
<p>「なっている<strong>はず</strong>」なのですが…</p>
<p>メールによっては、<strong>状況が変わる前の URL では、表示されない場合があります</strong>。</p>
<p>そういう場合、<span style="color: #0000ff;"><strong>#inbox や #label/[labelname] や#search/[検索語] などを #all に置き換えてやれば表示されます。</strong></span></p>
<p>例）<br />
受信箱にある<br />
https://mail.google.com/mail/<span style="color: #ff0000;">#inbox</span>/12e274e35ad122f5<br />
のメールに、_Business というラベルを付加して、アーカイブすると、</p>
<p>https://mail.google.com/mail/<span style="color: #ff0000;">#label/_Business</span>/12e274e35ad122f5<br />
https://mail.google.com/mail/<span style="color: #ff0000;">#inbox</span>/12e274e35ad122f5</p>
<p>のどちらでも表示されるはずだが、後者では、表示されない場合がある。<br />
<em>( すでに inbox に存在しないわけだから、表示されない方が自然な感じを受けますが ) </em></p>
<p>これでは、ラベルを付けたり外したり、アーカイブしたりすると、リンクが切れる場合があるという話になってしまう。</p>
<p>そこで…<br />
https://mail.google.com/mail/<span style="color: #0000ff;">#all</span>/12e274e35ad122f5<br />
というように、当該部分を <strong>#all</strong> にしてしまえば、パーマネントリンクになる…ということのようです。</p>
]]></content:encoded>
			<wfw:commentRss>http://bison.jp/cloud/791.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>FileMaker Dictionary 関数</title>
		<link>http://bison.jp/filemaker/715.html</link>
		<comments>http://bison.jp/filemaker/715.html#comments</comments>
		<pubDate>Tue, 21 Dec 2010 09:33:30 +0000</pubDate>
		<dc:creator>bison</dc:creator>
				<category><![CDATA[FileMaker]]></category>
		<category><![CDATA[Howto]]></category>

		<guid isPermaLink="false">http://bison.jp/?p=715</guid>
		<description><![CDATA[FileMaker Dictionary Functions 以下の blockquote部分は上記出典ページの段落、直後の日本語は内容の拙訳です。 拙訳への具体的な「ちげーよバカ！」な突っ込みは大歓迎です。 ※ 万一の [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://sixfriedrice.com/wp/filemaker-dictionary-functions/">FileMaker Dictionary Functions</a><br />
以下の blockquote部分は上記出典ページの段落、直後の日本語は内容の拙訳です。<br />
拙訳への具体的な「ちげーよバカ！」な突っ込みは大歓迎です。<br />
※ 万一のトラブルは、出典サイトはもちろん、(たとえそれが僕の拙訳のせいだとしても) 一切関知しませんのであしからず。</p>
<p>素晴らしいカスタム関数を発表してくれた sixfriedrice.com の Jesse Antunes / Geoff Coffey に感謝します。</p>
<hr />
<blockquote><p>Since many people were impressed with my named parameters article, I decided to write up another post about the dictionary functions. Actually in all fairness I think three people actually liked it. Vincenzo Menanno, Chris Wack and Sam Barnum this post’s for you!</p></blockquote>
<p>&#8220;named parameters (名前付きパラメータ)&#8221; 記事 への皆さんの食いつきがなかなかにすばらしいので、&#8221;the Dictionary functions&#8221; についての別の post を書くことにしました。<br />
まあ、公平にみて、3人の人たちがこれを気に入ってくれると考えています。<br />
Vincenzo Menanno, Chris Wack and Sam Barnum この post は君たち向けです！</p>
<blockquote><p>Note: This article was revised November 23, 2007. I added the handy<a style="color: #d0155a; text-decoration: underline; outline-style: none; outline-width: initial; outline-color: initial; background-color: transparent;" href="http://sixfriedrice.com/wp/filemaker-dictionary-functions/#replace"><strong><code style="overflow-x: auto; overflow-y: auto;">DictReplace</code></strong></a> function. -Geoff</p></blockquote>
<p>Note: この記事は、2007/11/23 に改訂しました。<br />
重宝な DictReplace 関数を付け足しました。 &#8211; Geoff</p>
<blockquote><p>First I must warn you, I have left the names of the custom functions the same as the functions we use internally. This means they may seem a little obtuse so feel free to change them. I’m also not getting to in-depth into how they actually work because it could take an extra 5 pages or so (yea I know Geoff… I’m lazy… deal with it). I’m sure most of you will get them pretty quickly despite my inept explanations. Oh yea, I also suggest going back and reading the named parameters post before getting into this post otherwise it probably won’t make much sense.</p>
<p>Enjoy…</p></blockquote>
<p>まず、最初の注意として…<br />
内部的に使っているカスタム関数の名前はそのまま残しました。<br />
ちょこっとダサイかも知れませんので、自由に変更してください。<br />
それに、どのように振る舞うかの詳細についてまでは触れていません。<br />
そこまでやると、簡単にもう5ページくらいかかってしまうので…はいはい面倒くさがりでごめんね。<br />
ほとんどの方は、私のダサダサな説明などいらないくらいにサクっとおわかりになるでしょうし。<br />
そうそう、 以前に post した &#8220;named parameters&#8221; の記事についても読んでいただいておいた方がよろしいでしょう。<br />
じゃないと、あんまわからない話になってしまうかも。</p>
<p>楽しんでください&#8230;</p>
<blockquote><p>Note: For the duration of this article I will refer to the custom function<strong><code style="overflow-x: auto; overflow-y: auto;">PassParameter( name ; value )</code></strong> in my previous post as #( ). This saves me 12 key strokes and won’t confuse me because that’s what I call it internally.</p></blockquote>
<p>Note; 以前 “PassParameter ( name ; value )” として紹介したカスタム関数を#( )としています。こいつのおかげで、12キーストローク楽になりましたし、関数の内部で使っているので別に自分は混乱しないです。<em>( bison 注：2011/02/12 21:09:18 修正しますた。by 今泉さんのありがたいツッコミ)</em></p>
<h2>Using a Dictionary in the Script Result</h2>
<h2>スクリプト結果で、Dictionary を使う</h2>
<blockquote><p>I actually posted this in the comments of the Named Parameters post. The idea here is that you can not only use the named parameter idea in your script parameters but in your script results as well. So just place your dictionary values in the script result dialog of the Exit Script script step and you’ve go yourself named script results. I like to create a little shortcut to access them like so:</p></blockquote>
<p>さて、これについては、&#8221;Named Parameters&#8221; の記事のコメントで post しました。<br />
このアイデアがここで意味するものは…<br />
named parameter のアイデアは、スクリプトパラメータだけでなく、スクリプト結果でも同様に使えるんだよ…ということです。<br />
ですから、スクリプト終了のスクリプトステップの スクリプト結果のダイアログに、あなたの dictionary の値を置いたものをスクリプト結果と名付けて処理を進めれるわけです。<br />
私は、以下のようなちょっとしたショートカットを作るのが好きです;</p>
<p><strong>Name: #R ( name )</strong></p>
<pre style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; background-color: #f7f7f7; overflow-x: auto; overflow-y: auto; clear: both; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 5px; font-size: 12px; border-color: #cccccc; border-style: solid; padding: 10px;"><code>Definition:

DictGet ( Get (ScriptResult) ; name )
</code></pre>
<h2>Checking for a Name in the Dictionary</h2>
<h2>Dictionary の中の名前をチェックする</h2>
<blockquote><p>There’s also a point where you may want to check if your dictionary contains a certain value. You could do this by simple using your DictGet() custom function on your Dict. By design, a call to the DictGet() will return empty if the name you are looking for isn’t there. That’s when I made DictContains?</p></blockquote>
<p>また、「特定の値が あなたの dictionary の中に含まれているかどうか」をチェックしたいときもあるでしょう。<br />
これは、シンプルに あなたの Dect について、DictGet ( ) カスタム関数を使うことで可能です。仕組みとして、あなたが探しているものがそこに無ければ、DictGet ( ) をコールすると、空値が返ります。<br />
それで、DictContains? を作ったのです。</p>
<p><strong>Name: DictContains? ( dict, name )</strong></p>
<pre style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; background-color: #f7f7f7; overflow-x: auto; overflow-y: auto; clear: both; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 5px; font-size: 12px; border-color: #cccccc; border-style: solid; padding: 10px;"><code>Definition
Let (
 pattern = "&lt;:" &amp; name &amp; ":=";  Position(dict; pattern; 1; 1) &gt; 0
)
</code></pre>
<blockquote><p>All this is doing is checking the dictionary structure for the name of the value you are looking for and returning true if it finds the value and false if it doesn’t.</p></blockquote>
<p>これが行うことのすべては、あなたが探している値の名前で、dictionary 構造 をチェックして、存在すれば true を返し、存在しなければ false を返すということです。</p>
<blockquote><p>Note: This will not find any nested dictionary values. So if you were to store a dictionary within a dictionary ie. #( “Account” ; #( “Name” ; “Jesse” ) &amp; #( “Job” ; “Writing confusing custom functions” ) ) you wouldn’t be able to use the <code style="overflow-x: auto; overflow-y: auto;">DictContains?</code> custom function to see if <code style="overflow-x: auto; overflow-y: auto;">Job</code> is in the dictionary because it is inside the account dictionary.</p></blockquote>
<p>Note: 入れ子になった distionary の値は見つけられません。<br />
ですから譬えば…<br />
#( “Account” ; #( “Name” ; “Jesse” ) &amp; #( “Job” ; “Writing confusing custom functions” ) )<br />
といった dictrionary において、&#8221;Job&#8221; が dictionary にあるかどうかをチェックするのに<br />
DictContains? を使うことはできません。<br />
なぜなら、&#8221;Job&#8221; は、Account dictionary の内部に存在するからです。</p>
<h2>Removing an Entry from a Dictionary</h2>
<h2>Dictionary から エントリを削除する</h2>
<blockquote><p>You never know when, but there will be a point where you think… “Man, I wish I could remove a value from my dictionary.” Well, maybe you won’t… but I wrote this thing anyway. If you happen to bump into this situation, you can use the nifty function below. DictRemove() simply removes the dictionary name/value pair specified from the dictionary passed in.</p></blockquote>
<p>いつとは言えませんが、こう考えることもあるでしょう。<br />
「なあ、オイラの dictionary の中から値を削除したいんだけど…」<br />
…まあ、ないかもしれませんが…とにかくそれについて書きました。<br />
もし、ばったり、そんな状況に出くわしたなら、下記の気の利いた関数を使うことができます。<br />
DictRemove ( ) は、特定の name/value のペアを、受け渡された dictionary からシンプルに削除します。</p>
<p><strong>Name: DictRemove ( dict , name )</strong></p>
<pre style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; background-color: #f7f7f7; overflow-x: auto; overflow-y: auto; clear: both; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 5px; font-size: 12px; border-color: #cccccc; border-style: solid; padding: 10px;"><code>Definition:

Let(
[
 pattern = "&lt;:" &amp; name &amp; ":=";  entry_start = Position( dict ; pattern ; 1 ; 1);  entry_end = Position( dict ; ":&gt;" ; entry_start + 1; 1);
 dict_beginning = If( entry_start &gt; 0 ; Left ( dict ; entry_start - 1 ) );
 rest_of_dict = Middle( dict ; entry_end + 2 ; 999999 );
 new_dict = dict_beginning &amp; rest_of_dict
];

If( entry_start &gt; 0 ; new_dict ; dict )
)
</code></pre>
<h2>Replacing an Entry in a Dictionary</h2>
<h2>Dictionary のエントリを置換する</h2>
<blockquote><p>This function is primarily for convenience. It combines DictRemove with a new entry to effectively replace a value in the dictionary in one shot:</p></blockquote>
<p>この関数は、やたら便利だったらありゃしません。<br />
DictRemove と新エントリを結合して、一発で dictionary 中の値を効果的に置き換えます。</p>
<p><strong>Name: DictReplace ( dict, name, value )</strong></p>
<pre style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; background-color: #f7f7f7; overflow-x: auto; overflow-y: auto; clear: both; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 5px; font-size: 12px; border-color: #cccccc; border-style: solid; padding: 10px;"><code>DictRemove(dict, name) &amp; #(name, value)
</code></pre>
<h2>Returning the Top Name in a Dictionary</h2>
<h2>Dictionary 中の Top Name を返す</h2>
<blockquote><p>This custom function was designed to return the name of the first name-value pair in the dictionary. Nothing too special, but I if used in conjunction with the DictRemove() function above, you can pop off the top value of the dictionary with ease.</p></blockquote>
<p>このカスタム関数は、dictionary 中の 最初の name/value のペアの name を返します。<br />
特別なことは何もしていませんが、上記の DictRemove ( ) 関数と連携させて使うと、簡単に、最初の値を消すことができます。</p>
<p><strong>Name: DictFirst( dict )</strong></p>
<pre style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; background-color: #f7f7f7; overflow-x: auto; overflow-y: auto; clear: both; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 5px; font-size: 12px; border-color: #cccccc; border-style: solid; padding: 10px;"><code>Definition:

Let(
   [startValue = "&lt;:";    endValue = ":=";    positionOfStartValue= Position( dict ; startValue ; 1 ; 1 );    endOfStartValue= If( positionOfStartValue &gt; 0 ; positionOfStartValue  + Length(startvalue); -1 );
   beginningOfEndValue= Position( dict; endValue; endOfStartValue; 1 );
   found = If( beginningOfEndValue &gt; -1 and endOfStartValue &gt; -1 ; True; False );
   lengthFoundValue = beginningOfEndValue - endOfStartValue;
   foundValue = Middle( dict; endOfStartValue ; lengthFoundValue )];

   If( found ; foundValue ; "" )
)
</code></pre>
<h2>Adding to a Dictionary</h2>
<h2>Dictionary に追加する</h2>
<blockquote><p>This custom function is ridiculously easy. It’s really just a shortcut that looks a little more succinct then actually performing the action manually.</p></blockquote>
<p>このカスタム関数は、バカほど簡単です。<br />
実際に手動で行うよりほんの少し簡潔にしたショートカットです。</p>
<p><strong>Name:DictAdd( dict; name; value )</strong></p>
<pre style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; background-color: #f7f7f7; overflow-x: auto; overflow-y: auto; clear: both; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 5px; font-size: 12px; border-color: #cccccc; border-style: solid; padding: 10px;"><code>Definition:

 dict &amp; #( name ; value )

</code></pre>
<h2>Dictionary To String</h2>
<h2>Dictionaryを文字列に</h2>
<blockquote><p>This is quite frankly my favorite custom function ever. Serioulsy, I have a ton of ridiculous functions that no one uses but me, but this is the creme de la creme. I’ll get slightly more indepth about this function because it can be a little tricky to understand. Here is the signature of the function:</p></blockquote>
<p>これは、実際率直に言って、お気に入りのカスタム関数です。<br />
マジに、自分以外だれが使うねん…な関数を山ほど使っていますが、こいつは、最高です。<br />
ただ理解するのにちょこっとトリッキーかも知れないので、やや詳細に言及します。<br />
これがこの関数の書式です。</p>
<pre>Name: DictToString
Parameters:
Dict: A dictionary of your choosing
Format: format you would like to display the data in.</pre>
<blockquote><p>The real magic of this function comes from the Format parameter. This parameter will dictate how you want the data displayed. The function goes through each and every dictionary entry and will put it into whichever format you specific. To achieve this functionality a replace is performed on the Format. $name is replaced with the name of the dictionary entry and $value is replaced with the value of the dictionary entry. Here is the function:</p></blockquote>
<p>この関数のキモは、Format parameter です。<br />
このパラメータには、「どのようにデータを表示させたいか」を記述します。<br />
この関数は、個々の dictionary エントリに対して実行され、あなたの指定したフォーマットに仕上げます。<br />
$name は、dictionary エントリの name と、$value は、value と置き換えられます。<br />
以下がその関数です。</p>
<p><strong>Name: DictToString( Dict ; Format )</strong></p>
<pre style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; background-color: #f7f7f7; overflow-x: auto; overflow-y: auto; clear: both; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 5px; font-size: 12px; border-color: #cccccc; border-style: solid; padding: 10px;"><code>Definition:

 Let(
  [
  firstName  = DictFirst ( dict );
  rawdata = DictGet(dict; firstName) ;
  data = If( not IsEmpty( DictFirst( rawdata ) ) ; DictToString( rawdata ; Format ); rawdata );
  rest = DictRemove( dict ; firstName )

   ];
    If( not IsEmpty(firstName) ;
   Substitute(
                format;
                ["$name"; firstName  ];
                ["$value"; data ]
               )
               &amp;
           If (
                not IsEmpty(rest);
                DictToString(rest; Format)
              )
 ; dict )
)
</code></pre>
<blockquote><p>Let’s say your Format parameter is:<br />
たとえば、あなたのフォーマットパラメータが以下のようだったとします。</p>
<pre style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; background-color: #f7f7f7; overflow-x: auto; overflow-y: auto; clear: both; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 5px; font-size: 12px; border-color: #cccccc; border-style: solid; padding: 10px;"><code>`"$name is $value"`
</code></pre>
<blockquote><p>and your dictionary is</p></blockquote>
<p>そして、あなたの dictionary がこうだったとします。</p>
<pre style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; background-color: #f7f7f7; overflow-x: auto; overflow-y: auto; clear: both; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 5px; font-size: 12px; border-color: #cccccc; border-style: solid; padding: 10px;"><code>`&lt;:Jesse:=nuts:&gt;`
</code></pre>
<blockquote><p>the output would be</p></blockquote>
<p>すると、出力はこうなります。</p>
<pre style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; background-color: #f7f7f7; overflow-x: auto; overflow-y: auto; clear: both; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 5px; font-size: 12px; border-color: #cccccc; border-style: solid; padding: 10px;"><code>`Jesse is Nuts`
</code></pre>
<blockquote><p>You can now basically output your dictionaries in any format you so desire. Such as…. you guessed it…. XML.</p></blockquote>
<p>基本的に、どんなフォーマットにでも思いのままに、あなたの dictionary を出力できます。<br />
たとえば…考えてみそ…XMLとか…</p>
<h2>Dictionary To XML</h2>
<h2>Dictionary を XML に</h2>
<blockquote><p>So once you understand the DictToString() custom function, the DictToXML() function is just a shortcut that I wrote so I don’t have to write the funky format over and over. Here is is:</p></blockquote>
<p>さて、DictToString ( ) を理解したところで、DictToXML ( ) 関数は、<br />
なんども繰り返し土臭いフォーマットを書かずにすむように作った<br />
単なるショートカットです。<br />
それはこうです。</p>
<p><strong>Name: DictToXML ( dict )</strong></p>
<pre style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; background-color: #f7f7f7; overflow-x: auto; overflow-y: auto; clear: both; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 5px; font-size: 12px; border-color: #cccccc; border-style: solid; padding: 10px;"><code>Definition:

DictToString ( dict , "&lt;$name&gt;$value&lt;$name&gt;" )
</code></pre>
<blockquote><p>Let’s say you setup your dictionary like so #( “account” ; #( “name” ; “Jesse” ) &amp; #( “birthday” ; “Yesterday” ) ). You’ll notice that I have put a pair of dictionaries within another dictionary named account. The DictToXML function (really the DictToString() function does the bulk of the work but you get the point) will actually iterate through the outside and inside dictionary and output the following:</p></blockquote>
<p>さて、あなたの dictionary を</p>
<pre>#( “account” ; #( “name” ; “Jesse” ) &amp; #( “birthday” ; “Yesterday” ) )</pre>
<p>と設定したとします。<br />
ふたつの dictionary をアカウントという名前のもうひとつの dictionaryに入れたことがわかりますね。<br />
DictToXML 関数 (ほとんどの機能を DictToString ( ) 関数が行うわけではありますが) は、外側と内側の dictionary を行ったり来たりして、以下を出力します。</p>
<pre style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; background-color: #f7f7f7; overflow-x: auto; overflow-y: auto; clear: both; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 5px; font-size: 12px; border-color: #cccccc; border-style: solid; padding: 10px;"><code>&lt;account&gt;
&lt;name&gt;Jesse&lt;/name&gt;
&lt;birthday&gt;Yesterday&lt;/birthday&gt;
&lt;/account&gt;
</code></pre>
<blockquote><p>This can be very useful for creating tidbits of xml to post to web actions. Sweet Huh?</p></blockquote>
<p>Webアクションに post するtidbits の XML を生成するのにピッタリだしょ？よかんべ？</p>
<hr />
<ol>
<li><a title="FileMaker – マルチプルスクリプトパラメータの受け渡し" href="http://bison.jp/filemaker/692.html">FileMaker – マルチプルスクリプトパラメータの受け渡し</a></li>
<li><a title="マルチプルパラメータのスクリプトへの受け渡し – 応用編" href="http://bison.jp/filemaker/701.html">マルチプルパラメータのスクリプトへの受け渡し – 応用編</a></li>
<li><strong><a title="FileMaker Dictionary 関数" href="http://bison.jp/filemaker/715.html">FileMaker Dictionary 関数</a> (このエントリ)</strong></li>
</ol>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://bison.jp/filemaker/715.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>マルチプルパラメータのスクリプトへの受け渡し &#8211; 応用編</title>
		<link>http://bison.jp/filemaker/701.html</link>
		<comments>http://bison.jp/filemaker/701.html#comments</comments>
		<pubDate>Tue, 21 Dec 2010 08:15:40 +0000</pubDate>
		<dc:creator>bison</dc:creator>
				<category><![CDATA[FileMaker]]></category>
		<category><![CDATA[Howto]]></category>

		<guid isPermaLink="false">http://bison.jp/?p=701</guid>
		<description><![CDATA[Passing Multiple Parameters to Scripts – Advanced 以下の blockquote部分は上記出典ページの段落、直後の日本語は内容の拙訳です。 拙訳への具体的な「ちげーよバカ！ [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://sixfriedrice.com/wp/passing-multiple-parameters-to-scripts-advanced/">Passing Multiple Parameters to Scripts – Advanced</a></p>
<p>以下の blockquote部分は上記出典ページの段落、直後の日本語は内容の拙訳です。<br />
拙訳への具体的な「ちげーよバカ！」な突っ込みは大歓迎です。<br />
※ 万一のトラブルは、出典サイトはもちろん、(たとえそれが僕の拙訳のせいだとしても) 一切関知しませんのであしからず。</p>
<p>素晴らしいカスタム関数を発表してくれた sixfriedrice.com の Jesse Antunes / Geoff Coffey に感謝します。</p>
<hr />
<blockquote><p>Wouldn’t it be nice if whenever you need a parameter you could just ask for it by name? Lets say that you have a create order script and you want to pass the script the name, street and zip code of the customer. If you were stuck with just the regular old FileMaker functions there ain’t no way that’s happening. But after you are done with this post, you will be able to get the name of your customer with the simple function: GetParameter( &#8220;customerName&#8221; ).</p></blockquote>
<p>もし、パラメータを使いたいときはいつでも名前で呼び出せるとしたら、いい感じじゃないですか？<br />
受注スクリプトがあったとしましょう。<br />
そして、そのスクリプトに対して、顧客の名前/住所/郵便番号を受け渡したいとします。<br />
もし、あなたが、FileMakerに元々ある関数で立ち往生しているばかりだとしたら、これはどうにもできません。<br />
しかし、この post の内容をやっつけた後だとしたなら、シンプルな関数で、顧客の名前をとりだすことができるでしょう:<br />
GetParameter (&#8220;customerName&#8221; )</p>
<blockquote><p>Alright, since your interest is hopefully already piqued, I’m just going to go ahead and tell you the functions right away. There are three of them. I know that sounds like a lot but if you give me a chance to explain myself, trust me your going to love it and once you get used to them you’ll never go back.</p></blockquote>
<p>さて、もう十分興味を刺激することはできたでしょうから、その関数の話の中身にさっさと移りましょう。<br />
３つあります。<br />
こう言うと大変そうでしょ？<br />
でも、まあだまされたと思って説明を聞いてくださいな。<br />
あまりに気に入ってしまって、これなしの世界に戻れなくなりますから。</p>
<pre style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; background-color: #f7f7f7; overflow-x: auto; overflow-y: auto; clear: both; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 5px; font-size: 12px; border-color: #cccccc; border-style: solid; padding: 10px;"><code>Name:  PassParameter
Parameters:  name,  value
Formula:  "&lt;:" &amp; Substitute( name; ["="; "/="]; [":"; "/:"] ; ["&gt;"; "/&gt;"]; ["&lt;" ; "/&lt;"]   ) &amp; ":="                  &amp; Substitute( value; ["="; "/="]; [":"; "/:"] ; ["&gt;"; "/&gt;"]; ["&lt;" ; "/&lt;"]   ) &amp; ":&gt;"

Name:  DictGet
Parameters:  dict, name
Formula:  Let( [
              match="&lt;:" &amp; Substitute( name ; ["="; "/="]; [":"; "/:"] ; ["&gt;"; "/&gt;"]; ["&lt;" ; "/&lt;"]   ) &amp; ":=";               pstart = Position(dict; match; 1; 1);               start = pstart + Length(match);               end = Position(dict ; ":&gt;"; start; 1);
              len = If(end = 0; 999999999; end - start)];

              If (pstart = 0; "";
              Substitute(Middle(dict; start; len); ["/:"; ":"]; ["/="; "="] ; ["/&gt;"; "&gt;"] ; ["/&lt;" ; "&lt;" ]))
)

Name:  GetParameter
Parameter:  name
Formula:  DictGet(Get(ScriptParameter); name)
</code></pre>
<blockquote><p>These different functions are probably a little bit confusing right now so lets go through them one by one.</p></blockquote>
<p>たぶん、これらの別々の関数を見て、ちょこっと脳みそがこんがらがっちゃったでしょうから、ひとつひとつ説明していくことにしましょう。</p>
<pre style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; background-color: #f7f7f7; overflow-x: auto; overflow-y: auto; clear: both; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 5px; font-size: 12px; border-color: #cccccc; border-style: solid; padding: 10px;"><code>PassParameter( name ; value )
</code></pre>
<blockquote><p>This custom function is your bread and butter. You use it every time you want to pass a parameter to another script. name is the name of the parameter your are passing and value is the actual text that you want to send over. So for instance if you were sending the name of your customer to a script you would use:</p></blockquote>
<p>これが基本です。<br />
別のスクリプトにパラメータを受け渡したいときには、これを使います。<br />
name というのは、受け渡したいパラメータの名前で、value は受け渡したい値そのものです。<br />
したがって、仮に、顧客の名前をスクリプトに渡したい場合はこうなります。</p>
<pre style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; background-color: #f7f7f7; overflow-x: auto; overflow-y: auto; clear: both; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 5px; font-size: 12px; border-color: #cccccc; border-style: solid; padding: 10px;"><code>PassParameter( "customer" ;  "Joe Blow" )
</code></pre>
<blockquote><p>If you want to pass multiple parameters to our order creation script would just string this custom function together using the ampersand like so:</p></blockquote>
<p>もし、受注システムに対して、複数のパラメータを受け渡したいのなら、&amp; (アンパサンド) を使って以下のように繋げて書けばいいわけです。</p>
<pre style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; background-color: #f7f7f7; overflow-x: auto; overflow-y: auto; clear: both; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 5px; font-size: 12px; border-color: #cccccc; border-style: solid; padding: 10px;"><code>PassParameter( "customerName" ;  "Joe Blow" ) &amp;
PassParameter( "street" ; "123 Any St." ) &amp;
PassParameter( "zip" ; 85282 )
</code></pre>
<blockquote><p>How it works: PassParameter() turns the name, value pairs that you pass in into a special format so that they are easy to manage. It basically puts two special characters in front of the name, between the name and value, and after the value. Basically if you were to say PassParameter( &#8220;customerName&#8221; ; &#8220;joe blow&#8221; ), this function turns your text into:</p></blockquote>
<p>実際の動き方：<br />
PassParameter ( ) は、name/value のペアを、処理しやすいように特殊なフォーマットに変換します。<br />
要は、name の前と、name と value の間と、value の後に、2文字の特殊な文字を追加するわけです。<br />
つまり、<br />
PassParameter( &#8220;customerName&#8221; ; &#8220;joe blow&#8221; )<br />
と書いたら、返ってくるのは…</p>
<pre style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; background-color: #f7f7f7; overflow-x: auto; overflow-y: auto; clear: both; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 5px; font-size: 12px; border-color: #cccccc; border-style: solid; padding: 10px;"><code>&lt;:customerName:=joe blow:&gt;
</code></pre>
<blockquote><p>or in the case of multiple parameters as above it would look like this:</p></blockquote>
<p>先述の複数のパラメータ例の場合は、以下のような感じになります。</p>
<pre style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; background-color: #f7f7f7; overflow-x: auto; overflow-y: auto; clear: both; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 5px; font-size: 12px; border-color: #cccccc; border-style: solid; padding: 10px;"><code>&lt;:customerName:=joe blow:&gt;&lt;:street:=123 Any St.:&gt;&lt;:zip:=85282:&gt;
</code></pre>
<blockquote><p>This construct of name and value pairs is what we refer to as a dictionary. This becomes important because our next function operates on a dictionary. You’ll notice in the actual definition of the function PassParameter() that I do a couple of substitutions. I use this process to escape the different characters that I use in my delimiters so that my scripts won’t break when you send in those same characters. Don’t worry though, when I get them back out I remove any extra characters that I added.</p></blockquote>
<p>この name/value のペア構造を dictionary として参照させているわけです。<br />
これは大変大切なことです。<br />
次の関数は、この dictionary を操作する関数です。<br />
PassParameter ( ) の定義式を見れば、二度ほど substitute をしていることがわかりますね。<br />
このプロセスは、デリミタ(区切り記号) として使っているのと同じ文字列をパラメータの内部で使っても、スクリプトが破綻しないように、別の文字列にエスケープするためのものです。<br />
余計な文字列は最終的には除去されますから、ご心配なく。</p>
<pre style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; background-color: #f7f7f7; overflow-x: auto; overflow-y: auto; clear: both; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 5px; font-size: 12px; border-color: #cccccc; border-style: solid; padding: 10px;"><code>DictGet( dict, name)
</code></pre>
<blockquote><p>The dict parameter in this custom function is, yup you guessed it, short for dictionary. The second parameter, â€˜name’, is just the name of a value that you would like to get out of the dictionary. So if you were to execute the following code:</p></blockquote>
<p>このカスタム関数内の dict という引数は、(はい！もうわかりましたね！)、dictionary の略ですね。<br />
2番目の引数の name は、dictionary から取り出したい値の名前です。<br />
ですから、もし以下のコードを実行すると…</p>
<pre style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; background-color: #f7f7f7; overflow-x: auto; overflow-y: auto; clear: both; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 5px; font-size: 12px; border-color: #cccccc; border-style: solid; padding: 10px;"><code>DictGet( "&lt;:customerName:=joe blow:&gt;&lt;:street:=123 Any St.:&gt;&lt;:zip:=85282:&gt;" ; "customerName" )
</code></pre>
<blockquote><p>It would return “Joe Blow”. On it’s own this DictGet function doesn’t seem that useful but it is the workhorse of the three functions.</p>
<p>How it Works: DictGet() actually works as a basic text parser. It takes the name that you pass in and turns it into the format you would expect in the dictionary. If the name passed in is “customerName”, then it would be turned into “&lt;:customerName:=”. The we take that weird looking text and search for it in the dictionary. If we find the weird string in the dictionary, then we return the value for it (”joe blow”, otherwise we return an empty string (”&#8221;). Pretty neat huh?</p></blockquote>
<p>“Joe Blow” が返ります。<br />
DictGet 関数は、これ自身のみではさほど役に立つとは思えないでしょう。<br />
しかし、DictGet 関数は、くだんの3つの関数の間で馬車馬のように働いてくれるのです。</p>
<p>実際の動き方：<br />
DictGet ( ) は、基本的なテキストパーサとして働きます。<br />
name を受け取ると、dictionary に対して、よき案配のフォーマットに変換します。<br />
渡された name が “customerName” だとすると、<br />
“&lt;:customerName:=”<br />
と変換されます。<br />
そしてこの妙ちくりんなテキストを、dictionary の中で探します。<br />
dictionaryの中に このへんてこテキストを見つけた場合、”joe blow” という値を返すわけです<br />
(見つからなければ、空値 &#8220;&#8221; が返されます)<br />
なかなかイケてるでしょ？</p>
<pre style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; background-color: #f7f7f7; overflow-x: auto; overflow-y: auto; clear: both; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 5px; font-size: 12px; border-color: #cccccc; border-style: solid; padding: 10px;"><code>GetParameter( name )
</code></pre>
<blockquote><p>This is the function you would use whenever you are trying to access data that was passed in using the PassParameter() function. It’s is specifically designed to operate on a script parameter that contains a dictionary. It actually just pulls the value of the name you give it, out of the script parameter using the DictGet() function. Very Simple…. not a whole lot going on here.<br />
Now that you have a pretty good understanding you are pretty much ready to enter into the world of named parameters. Once you get used to using these little gems, I am positive that you will never be able to go back to plain old vanilla script parameters ever again. There are a couple more benefits to using these functions such as using named values in your script results, nesting parameters and accessing multiple occurrences that I will probably get into a later date. For nowâ€¦ I hope these functions help make FileMaker Development a little easier for you.</p></blockquote>
<p>PassParameter ( ) 関数を使って受け渡されたデータにアクセスしたいときに使います。<br />
dictionary を内包するスクリプト引数を操作するため専用に作成しました。<br />
DictGet ( ) 関数を使って、スクリプト引数から、与えられた name にひもづく値を引き出すわけです。<br />
すごくシンプル。なんちうこたない。<br />
さて、なかなかいい感じで理解できたなら、named parameter の世界に入る準備はいい感じでOK ということです。<br />
いったん、これらのちょっとしたテクを使うのに慣れると、もう、あの古式ゆかしいペラッペラに薄っぺらな標準のスクリプト引数に二度と戻る気はさらさらなくなることでしょう。<br />
これらの関数を使うことで、他にも、二三の恩恵に浴することができます。<br />
スクリプトの結果から 名前で値を引っ張りだしたりとか、入れ子のパラメータからとか、後日言及する複数のオカレンスへのアクセスとか…ね。<br />
とりあえず、これらの関数が、あなたの FileMakerでのデータベース開発を少しでもラクチンにすることを願います。</p>
<blockquote><p>More About Dictionaries: If you would like to get a little more in-depth into these functions there is a second post that adds functionality to this idea here:<a href="http://sixfriedrice.com/wp/filemaker-dictionary-functions/">FileMaker Dictionary Functions</a>.</p>
<p>NOTE: We had a couple of good comments from some of our early release readers. Genx who blogs on <a href="http://www.filemakermagazine.com/blogs/aflgenx">FileMakerMagazine.com</a> added that he thought it would be much more visually appealing and easier to use XML style tags. I can’t remember the exact reason why I didn’t go this route… I am pretty sure it was because I wanted to have two delimiters at each break point in the name/value pair. He did convince us to change the names of the functions from our more nondescript names ( #() #P() ) we started with so that it would be easily understood what each one did. Another useful tip came from Fitch of<a href="http://www.pre1.com/">pre1.com</a>, who pointed out that another similar name/value pair implementation can be seen in <a href="http://www.seedcode.com/cp-app/ste_cat/backmagic">Back Magic from SeedCode.com</a></p></blockquote>
<p>dictionary 関連のより詳しい話：<br />
これらの関数についてもっと詳しく知りたい場合、下記の second post で、ここのアイデアの機能追加発展版な記事が読めますぜ。<br />
<a href="http://sixfriedrice.com/wp/filemaker-dictionary-functions/">FileMaker Dictionary Functions</a></p>
<p><a href="http://bison.jp/filemaker/715.html">日本語 拙訳</a></p>
<p>Note：初期版読者からの 良きコメントが、ふたつみっつありました。<br />
<a href="http://www.filemakermagazine.com/blogs/aflgenx">FileMakerMagazine.com の blog</a> をやっている Genx からは…<br />
XMLスタイルタグを使えば、もっと見た目で分かりやすくて訴求力のある感じになるんじゃね？…と。<br />
今となってはなんでそのルートに行かなかったのかを思い出せないのですが… おそらくは、たぶん name/value ペアのブレークポイント毎に、2文字のデリミタを差し込みたかったんだと思われます。<br />
また彼がそうしろというのがもっともなので、最初 #() #P() とかいう何なんだかわからない記述にしていたこれらのカスタム関数の名前を、何をするものなのか分かるような名前に変えることにしました。</p>
<p>もうひとつのナイスコメントは、<a href="http://www.pre1.com/">pre1.com</a> の Fitch でもって…<br />
似て非なる name/value ペアの実装方法を指摘してくれました。<br />
<a href="http://www.seedcode.com/cp-app/ste_cat/backmagic">Back Magic from SeedCode.com</a>で見られます。</p>
<hr />
<ol>
<li><a title="FileMaker – マルチプルスクリプトパラメータの受け渡し" href="http://bison.jp/filemaker/692.html">FileMaker – マルチプルスクリプトパラメータの受け渡し</a></li>
<li><strong><a title="マルチプルパラメータのスクリプトへの受け渡し – 応用編" href="http://bison.jp/filemaker/701.html">マルチプルパラメータのスクリプトへの受け渡し – 応用編</a> (このエントリ)</strong></li>
<li><a title="FileMaker Dictionary 関数" href="http://bison.jp/filemaker/715.html">FileMaker Dictionary 関数</a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://bison.jp/filemaker/701.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>FileMaker &#8211; マルチプルスクリプトパラメータの受け渡し</title>
		<link>http://bison.jp/filemaker/692.html</link>
		<comments>http://bison.jp/filemaker/692.html#comments</comments>
		<pubDate>Tue, 21 Dec 2010 07:45:41 +0000</pubDate>
		<dc:creator>bison</dc:creator>
				<category><![CDATA[FileMaker]]></category>
		<category><![CDATA[Howto]]></category>

		<guid isPermaLink="false">http://bison.jp/?p=692</guid>
		<description><![CDATA[FileMaker – Passing Multiple Script Parameters 以下の blockquote部分は上記出典ページの段落、直後の日本語は内容の拙訳です。 拙訳への具体的な「ちげーよバカ！」な突 [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://sixfriedrice.com/wp/passing-multiple-parameters-to-scripts/">FileMaker – Passing Multiple Script Parameters</a><br />
以下の blockquote部分は上記出典ページの段落、直後の日本語は内容の拙訳です。<br />
拙訳への具体的な「ちげーよバカ！」な突っ込みは大歓迎です。<br />
※ 万一のトラブルは、出典サイトはもちろん、(たとえそれが僕の拙訳のせいだとしても) 一切関知しませんのであしからず。</p>
<p>素晴らしいカスタム関数を発表してくれた sixfriedrice.com の Jesse Antunes / Geoff Coffey に感謝します。</p>
<hr />
<blockquote><p>I can think of hundreds of times when I found myself pounding my head against the desk because I had to define yet <em>another</em> global field just to pass a simple value from one script to another. Like you, I myself hate to have lots of cruft clogging up my databases. Luckily, FileMaker 7+ gave us the wonderful addition of script parameters to help relieve this plight. Sometimes, even this isn’t enough and that’s where passing multiple parameters takes over.</p></blockquote>
<p>あるスクリプトから別のスクリプトに対して、単純な値を渡すためだけに、グローバルフィールドをもうひとつ定義しなければならなくなって…「あーもー！」てなもんで、机に頭を打ちつけていた…あの光景を何百回も思い出すのことあります。<br />
あなたたちと同じで、わたしもデータベース開発作業の足を引っ張るたくさんのあれやこれやに辟易していました。<br />
幸運にも、FileMaker 7 以降では、こんな状況を少しは楽にしてくれる スクリプト引数なるものが追加されたわけですが、複数の引数を受け渡したいとかいうことになると、そんなもんじゃ足りなくなることもよくあります。</p>
<blockquote><p>Whenever a script is chosen in a perform script step, Filemaker shows a box for an optional script parameter. You can type in whatever your programming heart desires or you can click the edit button and take advantage of Filemaker’s many built-in functions to construct a parameter. Many times, when presented with this option you probably find yourself thinking . . . Boy, I wish I had space for a bunch of different parameters. Well with the use of that tiny edit button, a couple of Filemaker’s functions and a little bit of ingenuity this actually ends up being doable. To pass multiple parameters in filemaker we are basically going to make a Â¶ delimited list and then crowbar individual parameters out using the MiddleValues().</p></blockquote>
<p>スクリプト実行が選択されたときはいつでも、オプショナルなスクリプト引数のためのボックスが表示されます。<br />
あなたのプログラミング魂の赴くままに入力することも、編集ボタンを押して、ビルトインの関数を利用して引数を組み立てることもできます。<br />
そのとき何度もこう思ったはずです。<br />
「にいちゃんよー、一連のパラメータを書く場所がなんとかならんかねー。そのちっぽけな編集ボタンを使って、いくらかの FileMakerの関数を使ったひと工夫でよー。」<br />
FileMakerにおいて、複数の引数を受け渡すには、基本的に、改行区切りリストにぶちこんで、個々の引数を MiddleValues ( ) を使って無理矢理引っ張りだすことになるわけです。</p>
<blockquote><p>Ok, let’s say we are trying to create a new line item for an order we are going to fulfill for 3 iPhones at a price of $499. We don’t want to have to put the part number (iPhone), the description (”The coolest phone I have ever seen. Wow, it’s also really cheap!”) the quantity(3) and the price($499) in a bunch of different globals to pass our script, so we will just send them in using the script parameter. To do this, select the perform script step and pick the script you are going to call. Then hit the edit button next to the “Optional Script Parameter” box. Filemaker’s trusty old calculation window will pop up and you’re ready to roll. All you have to do is make the parameters you would like to pass into a list like so:</p></blockquote>
<p>では、たとえば今、499ドルの 3つの iPhone 用に 新しい項目 を作りたいとしましょう。</p>
<p>部品番号 (iPhone) とか、説明 (”The coolest phone I have ever seen. Wow, it’s also really cheap!”) とか、数量 (3)とか、価格 ($499)とかを、スクリプト引き渡しのために一連の別個のグローバルにいちいち入力したかないので、スクリプト引数を使って受け渡したいというわけです。</p>
<p>そのために、スクリプトステップを実行を選択して、実行するスクリプトを指定して、オプションのスクリプトパラメータの横にある編集ボタンをクリックします。<br />
FileMaker の古式ゆかしい計算ウィンドウがポップアップしたら準備完了です。<br />
やんなきゃいけないことは、受け渡したい引数を作ることです。</p>
<p>こんな感じで…</p>
<pre style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; background-color: #f7f7f7; overflow-x: auto; overflow-y: auto; clear: both; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 5px; font-size: 12px; border-color: #cccccc; border-style: solid; padding: 10px;"><code>"iPhone" &amp; ¶ &amp;
"The coolest phone I have ever seen.  Wow, it's also really cheap!" &amp;  ¶ &amp;
3 &amp; ¶ &amp;
499</code></pre>
<blockquote><p>Hit Ok and you are done with your parameter passing. Now comes the part where you pop the values you want from the script parameter. To do this we are just going to simply use the MiddleValues() function. The complete signature of Middlevalues() is:</p></blockquote>
<p>OKをたたいて引数受け渡しは完了。<br />
さて、お次ぎは、お好みの値を、スクリプト引数から引っ張りだすわけです。<br />
これには、シンプルに MiddleValues ( ) 関数を使うことになります。<br />
この場合の 完全な MiddleValues ( ) の書式は…</p>
<pre style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; background-color: #f7f7f7; overflow-x: auto; overflow-y: auto; clear: both; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 5px; font-size: 12px; border-color: #cccccc; border-style: solid; padding: 10px;"><code>
MiddleValues ( text ; startingValue ; numberOfValues )
</code></pre>
<blockquote><p>Note: Thanks to David Richards (from the comments) and Genx (from FMForums.com for pointing out that you can simplify these calcs using GetValue instead of MiddleValues. We needed FileMaker 7 support for this particular setup, but if you can live with 8+ only, they’re absolutely right. GetValue does not include the trailing Â¶ so you can avoid all the mumbo jumbo about cleaning that up.</p></blockquote>
<p>Note: David Richards (コメント欄から) と Genx (FMForums.com から) に感謝します。<br />
これらの計算式は、MiddleValues の代わりに、GetValue を使うことでシンプルになることを指摘してくれてありがとう。<br />
私たちは、この特有のセットアップで FileMaker 7 をサポートしなくちゃならないけど (だから MiddleValues で行くわけだけど)、8以降のみなら、彼らは完全に正しいわけです。<br />
GetValue だったら、改行を引きずることもないから、余計なジュゲムジュゲム的記述を削除できるね。</p>
<blockquote><p>The sole purpose of this function is taking a list of Â¶ separated values, exactly like we created in the previous step, and select the values you specify from it. For instance, let’s say we are in the script we called in the first step and we want to get the quantity out of the script parameter. All we would need to do is execute the following bit of code:</p></blockquote>
<p>この関数の唯一の目的は、(前のステップでやったように) 改行区切りリストを得ることと、そのリストから指定した値を取得することです。<br />
たとえば、最初のステップで呼び出したスクリプトのなかにいて、スクリプト引数から 数量を取り出したいとしましょう。<br />
下記のちょろっとしたコードを実行するだけです。</p>
<pre style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; background-color: #f7f7f7; overflow-x: auto; overflow-y: auto; clear: both; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 5px; font-size: 12px; border-color: #cccccc; border-style: solid; padding: 10px;"><code>
MiddleValues( Get ( ScriptParameter ) ; 3 ; 1 )
</code></pre>
<blockquote><p>This step tells Filemaker to start from the third value in the script parameter and return one value which is effectively just saying give me the third value in the list. If you want the fourth value, the price, just change the number 3 to a 4. The one will always stay the same because you wouldn’t really want to get more then one value out of the script parameter at a time. It wouldn’t really make sense in a typical script.</p>
<p>We have the value out, we still aren’t quite finished. The MiddleValues function doesn’t get ride of the annoying Â¶ that we tacked on the end of our parameters so to delete it we have to add the following code:</p></blockquote>
<p>このステップは、FileMaker に スクリプト引数の 3番目の値から 一行取得するということです。<br />
(実際には、リストの3番目をよこせと言ってるのと同じ)<br />
もし、4番目の価格の値が欲しいなら、3を4に変えるだけのことです。<br />
一度に複数の値をスクリプト引数から取り出したいことはないでしょうから、一行取得というのはいつも同じです。<br />
典型的なスクリプトではあんまり役にはたたないかもしれません。</p>
<p>値を取り出せはしましたが、まだ終わりではありません。<br />
MiddleValue 関数は、パラメータ全体をつなぐ改行を引きずったままなので、改行を削除するためには、以下のコードを追加してやらなければなりません。</p>
<pre style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; background-color: #f7f7f7; overflow-x: auto; overflow-y: auto; clear: both; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 5px; font-size: 12px; border-color: #cccccc; border-style: solid; padding: 10px;"><code>
Let(
      parameter = MiddleValues( Get ( ScriptParameter ) ; 2 ; 1 ) ;
      If (
            right ( parameter ; 1 ) = ¶ ;
            left( parameter; length( parameter ) - 1 ) ;
            parameter
          )
     )
</code></pre>
<blockquote><p>This code is a little confusing but it is basically saying if we have a Â¶ on the end of our parameter take it off.</p>
<p>Now that you have seen how we plan on getting the values out, you are probably thinking to yourself… What happens if I pass a Â¶ in the middle of one of my parameters. This isn’t exactly out of the realm of possibility and it would clearly break your code. For instance if you changed the description on the iphone to read:</p></blockquote>
<p>このコードは、頭が少しこんがらがるかもしれませんが、要は、パラメータの最後に改行があれば、それを削除しろと言っているだけのものです。</p>
<p>さて、値を取り出そうとする方法を見てきたわけですが、おそらくこう思っていらっしゃるでしょう。<br />
「パラメータの中に改行を含む値を持ちたい場合はどうなるん？」<br />
それはあり得ない領域の話ではありませんし、そうなれば明らかにアウトです。<br />
たとえば、iPhone の説明をこう変えたとしましょう。:</p>
<pre style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; background-color: #f7f7f7; overflow-x: auto; overflow-y: auto; clear: both; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 5px; font-size: 12px; border-color: #cccccc; border-style: solid; padding: 10px;"><code>
"iPhone" &amp; ¶ &amp;
"The coolest phone I have ever seen.¶Wow, it's also really cheap!" &amp;  ¶ &amp;
"" &amp; ¶ &amp;
499
</code></pre>
<blockquote><p>Unfortunately, Filemaker will mush (concatenate for you technical types) everything together and create the following list:</p></blockquote>
<p>残念ながら、FileMaker は、すべてを一緒に (数珠つなぎで) まぜこぜにして、以下のようなリストを吐き出すでしょう。</p>
<pre style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; background-color: #f7f7f7; overflow-x: auto; overflow-y: auto; clear: both; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 5px; font-size: 12px; border-color: #cccccc; border-style: solid; padding: 10px;"><code>
iPhone¶
The coolest phone I have ever seen.¶
Wow, it's also really cheap!¶
¶
499
</code></pre>
<blockquote><p>Now, everything has been shifted down one because of that extra Â¶ and we can no longer get the price, quantity nor description that we expect. To take care of this we have to escape the Â¶ so that it turns it into just a symbol rather then turning it into a new line in your text. To implement this change we will have to change how we create our list. I know I lied to you, you weren’t quite done with creating your parameter list. Here is the function you will need:</p></blockquote>
<p>こうなると、すべては、邪魔な改行のせいで一段下がってしまいます。<br />
価格も数量も、期待される形での説明も取得できなくなります。<br />
このことの面倒をみるには、改行をどうにかエスケープさせて、テキストを改行させるためだけのシンボルと扱うようにしなければなりません。<br />
この変更を実装するためには、リストの作成方法を変更しなければなりません。<br />
はい、嘘ついてました。パラメータリストの作成はまったく終わっていませんでした。<br />
以下が、必要な関数です。</p>
<pre style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; background-color: #f7f7f7; overflow-x: auto; overflow-y: auto; clear: both; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 5px; font-size: 12px; border-color: #cccccc; border-style: solid; padding: 10px;"><code>
Name: Parameter
Parameters: value
Formula: Substitute( value ; "¶"; "\¶" )  &amp; ¶
</code></pre>
<blockquote><p>Using our new code we would rewrite our last list to:</p></blockquote>
<p>新しいコードをつかうには、先述のリストも書き換える必要があります:</p>
<pre style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; background-color: #f7f7f7; overflow-x: auto; overflow-y: auto; clear: both; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 5px; font-size: 12px; border-color: #cccccc; border-style: solid; padding: 10px;"><code>
parameter( "iPhone" ) &amp;
parameter( "The coolest phone I have ever seen.¶Wow, it's also really cheap!" ) &amp;
parameter( "" ) &amp;
parameter( 499 )
</code></pre>
<blockquote><p>Not only does this list look a heck of a lot cooler, but it is more functional and a LOT easier to read. OK, we have a custom function to add parameters to a list, we should probably create one to get all that information out so we don’t have to type that horrible blob of code ever again:</p></blockquote>
<p>これでむちゃくちゃかっちょいーだけでなく、より機能的で、ものすごく読みやすくなったわけです。<br />
さあ、パラメータを追加するカスタム関数もあります。<br />
あのゾッとするコードの一塊をもうタイプしなくてすむようなすべての情報を一緒にしたヤツを作る必要があります:</p>
<pre style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; background-color: #f7f7f7; overflow-x: auto; overflow-y: auto; clear: both; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 5px; font-size: 12px; border-color: #cccccc; border-style: solid; padding: 10px;"><code>
Name: GetParameter
Parameters: number
Formula:
     Let(
          parameterValue = MiddleValues( Get ( ScriptParameter ) ; number ; 1 ) ;
          substitute( left( parameterValue; length( parameterValue ) - 1 ) ; "\¶" ' "¶" )
         )
</code></pre>
<blockquote><p>Before you go off and pass around parameters all willy nilly, there is one final warning when using this style of parameter passing. To demonstrate it, Let’s go back to our iPhone example. Say that you don’t want to include the quantity just yet, but you still want to send over the price and description. If you tried the following:</p></blockquote>
<p>さてパラメータを受け渡しまくり始めるには、まだ早いです。<br />
このパラメータ受け渡しスタイルを使うには、否応無しに、最後の警告をひとつしなければなりません。<br />
デモを行うために、例の iPhone の例に立ち返りましょう。<br />
数量を含めることは必要ないけれど、価格と説明の受け渡しは必要だとしましょう。<br />
もし以下のようにやってみると…</p>
<pre style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; background-color: #f7f7f7; overflow-x: auto; overflow-y: auto; clear: both; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 5px; font-size: 12px; border-color: #cccccc; border-style: solid; padding: 10px;"><code>
Parameter("iPhone") &amp;
Parameter("The coolest phone I have ever seen.  Wow, it's also really cheap!") &amp;
Parameter(499)
</code></pre>
<blockquote><p>The $499 will go into the quantity field because your script that creates the line item thinks that the quantity is the third value, but because the quatity isn’t there the price has shifted up into the third position. To alleviate this problem you just need to make sure that you ALWAYS pass all the parameters to a script, even if one is empty. So your parameter list should look like this:</p></blockquote>
<p>スクリプト的には、数量は3番目の値だと思っているわけですから、$499 は、数量フィールドに入ってしまいますが、実は、数量はそこではなく、その3番目の位置には、繰り上がって価格が来ることになります。<br />
この問題を軽減するには、(たとえ空っぽの値があったとしても)「いつどんなときも」すべてのパラメータをスクリプトに受け渡すことが条件になります。<br />
したがって、パラメータリストはこうなります:</p>
<pre style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; background-color: #f7f7f7; overflow-x: auto; overflow-y: auto; clear: both; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 5px; font-size: 12px; border-color: #cccccc; border-style: solid; padding: 10px;"><code>
Parameter("iPhone") &amp;
Parameter("The coolest phone I have ever seen.  Wow, it's also really cheap!") &amp;
Parameter("") &amp;
Parameter(499)
</code></pre>
<blockquote><p>Hopefully, many of you find this quite useful and it will help you build more powerful and less cluttered databases. For those who would like a more technically advanced way of passing parameters, where you can actually associate each parameter with a name, such as qty = 2, then check back soon for another article.</p></blockquote>
<p>願わくば、みなさんが、よりパワフルでよりすっきりしたデータベースを作る上で助けになり、有益であると思っていただければよいのですが。<br />
それぞれのパラメータを name と結びつけた (たとえば、gty = 2 みたいに) もっと技術的に進歩的なパラメータ受け渡し方法をお望みの向きには、別記事で。</p>
<hr />
<ol>
<li><strong><a title="FileMaker – マルチプルスクリプトパラメータの受け渡し" href="http://bison.jp/filemaker/692.html">FileMaker – マルチプルスクリプトパラメータの受け渡し</a> (このエントリ)</strong></li>
<li><a title="マルチプルパラメータのスクリプトへの受け渡し – 応用編" href="http://bison.jp/filemaker/701.html">マルチプルパラメータのスクリプトへの受け渡し – 応用編</a></li>
<li><a title="FileMaker Dictionary 関数" href="http://bison.jp/filemaker/715.html">FileMaker Dictionary 関数</a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://bison.jp/filemaker/692.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PassParameter 関連カスタム関数 のいいかげんな和訳をしてみるYO!</title>
		<link>http://bison.jp/filemaker/687.html</link>
		<comments>http://bison.jp/filemaker/687.html#comments</comments>
		<pubDate>Tue, 21 Dec 2010 06:57:21 +0000</pubDate>
		<dc:creator>bison</dc:creator>
				<category><![CDATA[FileMaker]]></category>
		<category><![CDATA[Howto]]></category>

		<guid isPermaLink="false">http://bison.jp/?p=687</guid>
		<description><![CDATA[先日の FileMakerカンファレンス 2010 で、ユーザーグループのよろず相談コーナーを何時間か担当しました。 僕の最初の担当時間は、午後一で、メイン会場の階に、ちゃんとした場所が確保できず、サブ会場の階の「迷子以 [...]]]></description>
			<content:encoded><![CDATA[<p>先日の FileMakerカンファレンス 2010 で、ユーザーグループのよろず相談コーナーを何時間か担当しました。</p>
<p>僕の最初の担当時間は、午後一で、メイン会場の階に、ちゃんとした場所が確保できず、サブ会場の階の「迷子以外だれがこんなとこ来るねん」な場所でした。</p>
<p>案の定、「すみません、ココへ行きたいんですけど…」な人々相手に、立番おまわりさんな状況で、一時間ほど過ごしたわけですが、人生、悪いことばかりではなく、<strong>すこぶる良いこと</strong>がありました。</p>
<p>それは、有賀さんと今泉さんに、PassParameter などの Dictionary Function の話を聞けたことです。</p>
<p>上述の通り、「暇すぎて死にそう」な1時間に、たまたま僕と同じ時間帯に、よろず相談コーナーに座っていたのがお二人で、<br />
することもないので、いろいろと四方山話のうちに、このすばらしいカスタム関数について伺いました。</p>
<p>いたく感動した僕は、いただいた 超有益なカスタム関数の情報を、ガメているのもなんだし(生来のしゃべりたがり屋の性惰ゆえというのが実のところですが) と、FileMakerがらみの人に会う度に、その話をしたわけです。<br />
もちろん、出典 URL もその度にメールしました。</p>
<p>しかし…こちらと同じテンションで、よろこんでくれる人が非常に少ないわけです。</p>
<p>理由の一部には、おそらく当該Blogエントリが(割りと軽〜い語り口の)英語であることも問題なのではないかと思うに至りました。</p>
<p>ちうことで、使い勝手のあるすばらしいカスタム関数を発表してくれた <a href="http://sixfriedrice.com/wp/">six.fried.rice</a> の Jesse Antunes タソに ありがとうの意味を込めて、いいかげんこの上ない日本語に訳してみる気になったのでつ。</p>
<p>以下の順番で読み進めれば、分かりやすいと思われます。</p>
<ol>
<li><a title="FileMaker – マルチプルスクリプトパラメータの受け渡し" href="http://bison.jp/filemaker/692.html">FileMaker – マルチプルスクリプトパラメータの受け渡し</a></li>
<li><a title="マルチプルパラメータのスクリプトへの受け渡し – 応用編" href="http://bison.jp/filemaker/701.html">マルチプルパラメータのスクリプトへの受け渡し – 応用編</a></li>
<li><a title="FileMaker Dictionary 関数" href="http://bison.jp/filemaker/715.html">FileMaker Dictionary 関数</a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://bison.jp/filemaker/687.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSVファイルを出力して FTPアップロードするまでを FileMaker のスクリプトで行う方法 (Mac OS X)</title>
		<link>http://bison.jp/macosx/669.html</link>
		<comments>http://bison.jp/macosx/669.html#comments</comments>
		<pubDate>Sat, 11 Dec 2010 05:24:58 +0000</pubDate>
		<dc:creator>bison</dc:creator>
				<category><![CDATA[FileMaker]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Mac Software TIPS]]></category>
		<category><![CDATA[MacOSX]]></category>

		<guid isPermaLink="false">http://bison.jp/?p=669</guid>
		<description><![CDATA[某クライアント (不動産業) の案件で、『CSV を 吐き出して、FTPで (あらかじめ規定された) Webサーバ上のフォルダ にアップロードする』というものがありました。 そのクライアントは、社内業務に FileMak [...]]]></description>
			<content:encoded><![CDATA[<p>某クライアント (不動産業) の案件で、『CSV を 吐き出して、FTPで (あらかじめ規定された) Webサーバ上のフォルダ にアップロードする』というものがありました。</p>
<p>そのクライアントは、社内業務に FileMaker を使っているので、FileMaker (Mac OS X) のスクリプトで実行したいわけです。</p>
<p>条件は、以下の通り。</p>
<ol>
<li>CSVファイルの文字コードは、UTF-8 / 改行コードは、LF。</li>
<li>CSVファイル名は、YYYYMMDDhhmmss_テーブル識別子.csv の形式。</li>
<li>CSV出力と同時にFTPアップロードする。</li>
<li>FTPユーザ名/パスワードなどのFTP関連情報は、FileMakerアクセスからは隠す。</li>
<li>Macを少しだけ使えるスタッフが、Macで、FTPサーバアドレス/FTPユーザ名/パスワードなどのFTP関連情報 をいつでも修正できるように。</li>
</ol>
<p>1 は、普通にCSV(UTF-8)書き出し後に (Mac OS X での出力なので 改行コードが CR なので LF に修正するために)</p>
<blockquote><p><strong>$ perl -p -e &#8216;s/\r/\n/g&#8217; &lt; CR.txt &gt; LF.txt</strong></p></blockquote>
<p>とやってやればOKですし、なんなら、XML FMPRESULT 指定で…という方法もあります。</p>
<p>2 は、<br />
テーブル識別子を $tableid というグローバル変数に格納しておいて、</p>
<blockquote><p>Let ( [</p>
<p>$YYMMDD = GetAsText ( Year ( Get ( 日付 ) ) * 10000 + Month ( Get ( 日付 ) ) * 100 + Day ( Get ( 日付 ) ) ) ;<br />
$hhmmss = Right (<br />
"000000" &amp; GetAsText ( Hour ( Get ( 時刻 ) ) ) * 10000 + Minute ( Get ( 時刻 ) ) * 100 + Seconds ( Get ( 時刻 ) )  ;<br />
6<br />
) // Right<br />
] ;<br />
$YYMMDD &amp; $hhmmss &amp; &#8220;_&#8221; &amp; $tableid &amp; &#8220;.csv&#8221;<br />
) // Let</p></blockquote>
<p>とかやってやればOKでしょう。</p>
<p>3 も、4 の条件がなければ、シェルコマンドを do shell script な AppleScript ではじいてやればOKのはずなのですが、この場合、AppleScript内に、FTPユーザ名/パスワードなどの情報を書き込むことになります。<br />
では、FTP情報を埋め込んだ AppleScript をアプリケーション形式で保存しておいて、それを叩いてやれば良さそうなものですが、<br />
5 の条件でいう<strong>『Macを少しだけ使えるスタッフ』</strong>には、<strong>AppleScript の編集は、少し荷が重すぎる</strong>ようです。</p>
<p>…で、「どうやって、FTPアップロードすべ？」と悩んでいたわけです。</p>
<p><a href="http://bison.jp/wp-content/uploads/2010/12/UploadtoFTP.jpg"><img class="alignright size-medium wp-image-683" title="UploadtoFTP" src="http://bison.jp/wp-content/uploads/2010/12/UploadtoFTP-300x289.jpg" alt="Automator Acriotn : Upload to FTP を使った Automatorフロー例" width="300" height="289" /></a>いっそのこと、Transmit 4 などの FTPクライアントソフトの AppleScript 機能を使って…という『一応の解』が出ていたわけですが…ふと「<strong>Automator</strong> でどーよ！？」と思いました。</p>
<p>「Automator なら Automator のフロー側に FTPユーザ名/パスワードなどをリテラルで格納すれば、<strong>FTP関連情報をFileMaker アクセスからは隠せる</strong>し、Automatorのワークフローの修正なら、<strong>『Macを少しだけ使えるスタッフ』にも修正可能！」</strong></p>
<p><strong> </strong>探したところ、<a href="http://editkid.com/upload_to_ftp/"><strong>Upload to FTP</strong></a>という <strong>Automator Action</strong> がありました。<br />
これを使って、CSV書き出し用フォルダに、<strong>フォルダアクション</strong> として設定すれば、オールOK！</p>
<p>具体的な手順の説明は、また後日。</p>
]]></content:encoded>
			<wfw:commentRss>http://bison.jp/macosx/669.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>名前を覚えていないアプリケーションを用途から検索する方法 1</title>
		<link>http://bison.jp/macosx/mac-software-tips/505.html</link>
		<comments>http://bison.jp/macosx/mac-software-tips/505.html#comments</comments>
		<pubDate>Wed, 24 Mar 2010 04:51:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[Mac Software TIPS]]></category>

		<guid isPermaLink="false">http://bison.jp/uncategorized/505.html</guid>
		<description><![CDATA[MacUpdate Promo や macZOT などで使えそうなアプリケーションをすぐに購入する傾向が僕にはある。それらのサイトから購入するアプリケーションは、そのほとんどすべてが Sherewareで、当然、試用がで [...]]]></description>
			<content:encoded><![CDATA[<p style="clear: both">MacUpdate Promo や macZOT などで使えそうなアプリケーションをすぐに購入する傾向が僕にはある。<br />それらのサイトから購入するアプリケーションは、そのほとんどすべてが Sherewareで、当然、試用ができるから、「使えない」と判断したものは、即座にアンインストールする。</p>
<p style="clear: both">それでも、僕のアプリケーションフォルダを開くと、<strong>300以上</strong>の項目数が存在する。</p>
<blockquote style="clear: both"><p><strong>ほぼ同用途のアプリケーションが複数存在するのである。</strong></p>
</blockquote>
<p style="clear: both">同じことをするなら、用途ごとに、ひとつのアプリケーションだけを使えばいいではないか…という考えもあるだろう。</p>
<p style="clear: both">しかし、個々の利用シーンによって、Aというアプリケーションが一番使いやすかったり、Bというアプリケーションが一番使いやすかったりするのは事実である。</p>
<p style="clear: both">例えば、ある動画があって、これを AppleTVで再生できる形式に変換したい…という場合を想定してみて欲しい。</p>
<ul style="clear: both">
<li>元動画の音声が小さくて、変換ついでに、音量を150%にしたいなら、<strong>VisualHub</strong> を使うべきである。</li>
<li>元動画がDVDであるなら、<strong>HandBrake</strong> がいい。</li>
<li>元動画ファイルのコーデックが (H.264など) そのままでよく、コンテナだけを変えるだけでAppleTVで再生できるなら、<strong>VideoDrive</strong> が手っ取り早い。</li>
</ul>
<p style="clear: both">問題は…</p>
<blockquote style="clear: both"><p><strong>とてもじゃないが、</strong><br /><strong>アプリケーションの名前を用途ごとに全部なんて覚えていられない</strong></p>
</blockquote>
<p style="clear: both">ということだ。ｗ</p>
<p style="clear: both">この問題点の解決方法を、エントリにしてみたいと思う。</p>
<p><br class="final-break" style="clear: both" /></p>
]]></content:encoded>
			<wfw:commentRss>http://bison.jp/macosx/mac-software-tips/505.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CloudShare Pro は使い出すまで5分とかからない</title>
		<link>http://bison.jp/business/503.html</link>
		<comments>http://bison.jp/business/503.html#comments</comments>
		<pubDate>Thu, 04 Mar 2010 19:03:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[MacOSX]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[クラウド]]></category>

		<guid isPermaLink="false">http://bison.jp/uncategorized/503.html</guid>
		<description><![CDATA[CloudShareがソフトのデモや教育訓練をクラウド上で行うサービスの軽量無料バージョンを開始 Share by Leena Rao on 2010年2月27日 本誌が最近紹介したCloudShareは、ソフトウェアの [...]]]></description>
			<content:encoded><![CDATA[<blockquote style="clear: both"><p><strong>CloudShareがソフトのデモや教育訓練をクラウド上で行うサービスの軽量無料バージョンを開始</strong><br /> <em>Share by Leena Rao on 2010年2月27日</em> <br />本誌が最近紹介した<a href="http://www.cloudshare.com/">CloudShare</a>は、ソフトウェアのデモをクラウド上でやってくれるサービスだ。ユーザは、同じソフトを複数使って複数のそれぞれ独立したデモを同時に簡単に展開でき、あるいはCloudShareのプラットホームを教育訓練のためのプラットホームとしても利用できる。今日（米国時間2/15）そのCloudShareが、個人や小企業向けに、サービスを簡略化し無料化したCloudShare Proを立ち上げた。</p>
</blockquote>
<p style="clear: both"><img src="http://bison.jp/wp-content/uploads/2010/03/csp-thumb.jpg" height="321" width="380" style=" text-align: center; display: block; margin: 0 auto 10px;" />link: <a href="http://jp.techcrunch.com/archives/20100215cloudshare-launches-lightweight-version-of-software-deployment-platform/">CloudShareがソフトのデモや教育訓練をクラウド上で行うサービスの軽量無料バージョンを開始</a>  </p>
<blockquote style="clear: both"><p><strong>CloudShare</strong></p>
<p>CloudShare (formerly IT Structures) replicates fully-functional IT environments in the cloud in seconds, enabling you to give everyone their own copy of the same base system – their own personal datacenter replica – that they can use and modify while you monitor and manage. Users can do anything with the system that they can do on-premises, including saving records, loading data, and even integrating with their local enterprise systems.</p>
</blockquote>
<p style="clear: both">link: <a href="http://www.crunchbase.com/company/cloudshare">CloudShare Company Profile</a>  </p>
<p style="clear: both">………………………………………………………………………………………………</p>
<p>…という話なので、Mac環境で、登録から試用まで問題なくできるものなのか試してみました。</p>
<p style="clear: both">さして難しいことはありませんでした。<br />結論として、下記の注意事項に気をつければ、5分以内で使い始められます。</p>
<p style="clear: both">段取りとしては…<br /><a href="http://www.cloudshare.com/">CloudShare</a> にアクセスして、メアドとパスワードを入力し、アカウントを作成して、そのままウィザードに従えば、CentOS 5 だの、Windows 2008 Server だの Windows 7 だのの環境をクラウド上で使えます。</p>
<p style="clear: both"><strong>注意事項：</strong></p>
<ul style="clear: both">
<li>Remote Desktop Connection for Mac を使えという下図のようなアラートが出てきますが、環境の選択とインストールまでは、無視してやってみましたが問題ないようです。</li>
<li>環境は、数個(8つまで？)持てるようです。それぞれに異なるプラットホームを指定できますが、インストール終了後、当該リモートホストにアクセスするのは、ブラウザのJavaではエラーが出ましたので、言われたとおり、Remote Desktop Connection for Mac を使うことになります。</li>
</ul>
<p style="clear: both"><a href="http://bison.jp/wp-content/uploads/2010/03/warning-full.png" class="image-link"><img class="linked-to-original" src="http://bison.jp/wp-content/uploads/2010/03/warning-thumb2.png" height="71" width="373" style=" text-align: center; display: block; margin: 0 auto 10px;" /></a><strong>最重要事項：</strong></p>
<p>(Macやサポート外ブラウザを使っていると上手のようは ワーニングで邪魔されますが、ワーニングは、&#8221;hide now&#8221; もしくは &#8220;don&#8217;t show again&#8221; をクリックして閉じると) 下図のような画面になります。</p>
<p style="clear: both"><a href="http://bison.jp/wp-content/uploads/2010/03/Environment.png" class="image-link"><img class="linked-to-original" src="http://bison.jp/wp-content/uploads/2010/03/Environment-thumb.png" height="343" width="380" style=" text-align: center; display: block; margin: 0 auto 10px;" /></a><strong><u><a href="http://bison.jp/wp-content/uploads/2010/03/warning-full.png">この画面</a>のときのURLをブックマーク</u></strong>しておいて下さい。<br />URIは、おそらく、<br />http://use.cloudshare.com/Pro/Environment.mvc/View/<br />の後に、何桁かの乱数のような文字列が続く形式になると思われます。</p>
<p style="clear: both"><strong>ホスト名や、ユーザ名/パスワードについて</strong></p>
<p style="clear: both">上記画面の、赤枠内 External Address:の値がホスト名(ドメイン)、Username:はたぶんAdministrator固定？、Password:の値がパスワードになります。<br />これらを、Remote Desktop Connection for Mac に入力してアクセスします。<br />なお、赤枠部分が表示されていない場合は、上図の <strong>Hide detail</strong>sという青文字が、<strong>More details</strong> になっている と思いますので、ここをクリックして、detail を表示させて下さい。<br /><em>※ 図では、二つのプラットフォーム (Windows Server 2008 Enterprise Edition x64 と CentOS 5) を入れてみました。<br />赤枠で囲まれている Windows Server 2008 の方を例にして説明しました。</em></p>
<p><br class="final-break" style="clear: both" /></p>
]]></content:encoded>
			<wfw:commentRss>http://bison.jp/business/503.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>英語サイトの技術情報を日本語で読む方法</title>
		<link>http://bison.jp/howto/471.html</link>
		<comments>http://bison.jp/howto/471.html#comments</comments>
		<pubDate>Fri, 19 Feb 2010 07:38:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Howto]]></category>

		<guid isPermaLink="false">http://bison.jp/?p=471</guid>
		<description><![CDATA[職業柄、Internet を利用して、欲しい情報に行き着くのは手早い方だとは思っている。 コツみたいなものを教えろとの話で、先ほど、Google検索の応用例として『Twitter Search のサーチオプションについて [...]]]></description>
			<content:encoded><![CDATA[<p>職業柄、Internet を利用して、欲しい情報に行き着くのは手早い方だとは思っている。</p>
<p>コツみたいなものを教えろとの話で、先ほど、Google検索の応用例として『Twitter Search のサーチオプションについての説明が日本語で読みたい場合』を例にとって某顧問先に説明したら、意外なほど驚かれたので、一応エントリにしておこうかと。<img title="もっと読む..." src="http://bison.jp/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" alt="" /></p>
<p>Twitter Search の具体的な使い方を調べることを例にとることにする。</p>
<h3>さて、僕は、こと技術的な情報に限っては、質も量も整理のされ方も鮮度も詳細さも、日本語のサイトは、英語のサイトの足元にも及ばないと思っている。</h3>
<p>したがって、まずは、英語で検索する。</p>
<blockquote><p>twitter search secret</p></blockquote>
<p>こういう場合、search option とかで検索するより、secret (コツ) とか how to use とかの方が、くだけた表現のページが検索結果になることが多い。<br />
また、how to use とかより secret の方が、読みやすかったり、 ストーリー仕立てになっていたりと、書き手のサービス精神が発揮されたサイトである可能性が高いように感じる。</p>
<p>すると、トップヒット は、<br />
<a href="http://b.hatena.ne.jp/entry/www.twitip.com/7-%E2%80%98secret%E2%80%99-ways-to-use-twitter-search/">はてなブックマーク &#8211; 7 &#8216;Secret&#8217; Ways To Use Twitter Search </a><br />
(予想通り)  Socialブックマークである。<br />
ここ数年、本記事よりも、本記事に言及した Socialブックマークサイトが上位にHitすることは、どうにもこうにも納得いかないが、本稿とは別の話なので、後に機を譲ることとする。</p>
<p>さて、このページからリンクされている本記事は、</p>
<h2><a id="head-entry-link" href="http://www.twitip.com/7-%E2%80%98secret%E2%80%99-ways-to-use-twitter-search/">7 ‘Secret’ Ways To Use Twitter Search</a></h2>
<p>見てみると、一目で理解しやすいレイアウトである。<br />
しかし、英語がダメという日本人は多いし、僕自身も英語の情報を理解するには、日本語のそれと比べて 3倍は時間がかかる。</p>
<p>横着して、日本語で読むことにする。</p>
<p>こういう場合、自動翻訳サイトの機能を使うのはナンセンス。<br />
[日本語のページを検索]にチェックを入れてから、検索窓に以下のように入れて検索する。</p>
<blockquote><p>link:<a href="http://www.twitip.com/7-%E2%80%98secret%E2%80%99-ways-to-use-twitter-search/">http://www.twitip.com/7-‘secret’-ways-to-use-twitter-search/</a></p></blockquote>
<p>つまり、<br />
<strong><br />
<blockquote>link:</p></blockquote>
<p>というテキストに続けて、(半角スペースなど置かずに)英語サイト  &#8221;7 ‘Secret’ Ways To Use Twitter Search&#8221; のURLをペーストするわけ。</strong></p>
<p>「検索窓には少し違う文字列が入るじゃないか」と細かいことに気がついた貴方。</p>
<blockquote><p>
link:http://www.twitip.com/7-%E2%80%98secret%E2%80%99-ways-to-use-twitter-search/
</p></blockquote>
<p>このように、 URLエンコードされるのは、昨今のブラウザの機能なので無視していただいて結構。</p>
<p>さて、これで、<strong>&#8220;7 ‘Secret’ Ways To Use Twitter Search&#8221;へのリンクのあるサイト</strong> を拾ってくる。</p>
<p>結果、たったの5件になった。<br />
最上位は、またも はてなブックマーク なので無視。</p>
<p>2番目にランクされているページの題名がまさに目的とするものであることを示している</p>
<h2><a href="http://www.ideaxidea.com/archives/2009/06/twitter_search_options.html">これだけは覚えておきたい、Twitter検索で使える便利なオプションまとめ</a></h2>
]]></content:encoded>
			<wfw:commentRss>http://bison.jp/howto/471.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

