<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: FileMaker 9 Tip#4: Temporary Files</title>
	<link>http://sixfriedrice.com/wp/filemaker-9-tip4-temporary-files/</link>
	<description>smart business solutions</description>
	<pubDate>Thu, 04 Dec 2008 21:59:37 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.3</generator>
		<item>
		<title>By: dontoon</title>
		<link>http://sixfriedrice.com/wp/filemaker-9-tip4-temporary-files/#comment-1101</link>
		<dc:creator>dontoon</dc:creator>
		<pubDate>Wed, 21 May 2008 16:41:18 +0000</pubDate>
		<guid>http://sixfriedrice.com/wp/filemaker-9-tip4-temporary-files/#comment-1101</guid>
		<description>As always, there are many ways to achieve the same results in FileMaker.  I just create 2 container fields, "file," and "fileref."  Then Insert File is a scripted button where first a reference is stored in "fileref," than a variable GetAsText grabs the filepath, and uses it to insert the actual file in "file."  Now you can have both the benefits of having the actual file, and that of opening the file using the techniques described above.</description>
		<content:encoded><![CDATA[<p>As always, there are many ways to achieve the same results in FileMaker.  I just create 2 container fields, &#8220;file,&#8221; and &#8220;fileref.&#8221;  Then Insert File is a scripted button where first a reference is stored in &#8220;fileref,&#8221; than a variable GetAsText grabs the filepath, and uses it to insert the actual file in &#8220;file.&#8221;  Now you can have both the benefits of having the actual file, and that of opening the file using the techniques described above.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Gosney</title>
		<link>http://sixfriedrice.com/wp/filemaker-9-tip4-temporary-files/#comment-687</link>
		<dc:creator>Robert Gosney</dc:creator>
		<pubDate>Mon, 08 Oct 2007 15:42:53 +0000</pubDate>
		<guid>http://sixfriedrice.com/wp/filemaker-9-tip4-temporary-files/#comment-687</guid>
		<description>Geoff,

Thanks.  That's the answer.  I've been a programmer since 1982, and my company has just purchased Filemaker Server and the Clients.  I now have to "re-educate" myself!   This is a whole different world from PHP, or C++.   Thanks for the help.

My next great discovery will be to find the function that "flags" when the contents of a field have been changed in a table.  I believe that there is a function out there in Filemaker for this, just don't know where.

Thanks again!

Bob</description>
		<content:encoded><![CDATA[<p>Geoff,</p>
<p>Thanks.  That&#8217;s the answer.  I&#8217;ve been a programmer since 1982, and my company has just purchased Filemaker Server and the Clients.  I now have to &#8220;re-educate&#8221; myself!   This is a whole different world from PHP, or C++.   Thanks for the help.</p>
<p>My next great discovery will be to find the function that &#8220;flags&#8221; when the contents of a field have been changed in a table.  I believe that there is a function out there in Filemaker for this, just don&#8217;t know where.</p>
<p>Thanks again!</p>
<p>Bob</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Geoff Coffey</title>
		<link>http://sixfriedrice.com/wp/filemaker-9-tip4-temporary-files/#comment-680</link>
		<dc:creator>Geoff Coffey</dc:creator>
		<pubDate>Sat, 06 Oct 2007 21:38:01 +0000</pubDate>
		<guid>http://sixfriedrice.com/wp/filemaker-9-tip4-temporary-files/#comment-680</guid>
		<description>@Bob: I may be misinterpreting your question, but you can put a variable value into a field using the &lt;code&gt;Set Field&lt;/code&gt; script step:

&lt;pre&gt;&lt;code&gt;
   Set Field [ My Field; $my_variable ]
&lt;/pre&gt;&lt;/code&gt;

Does that help?</description>
		<content:encoded><![CDATA[<p>@Bob: I may be misinterpreting your question, but you can put a variable value into a field using the <code>Set Field</code> script step:</p>
<pre><code>
   Set Field [ My Field; $my_variable ]
</code></pre>
<p>Does that help?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Gosney</title>
		<link>http://sixfriedrice.com/wp/filemaker-9-tip4-temporary-files/#comment-648</link>
		<dc:creator>Robert Gosney</dc:creator>
		<pubDate>Wed, 03 Oct 2007 16:31:23 +0000</pubDate>
		<guid>http://sixfriedrice.com/wp/filemaker-9-tip4-temporary-files/#comment-648</guid>
		<description>I have had a similar issue with variable that are available during a script, and allow for all sorts of data comparisons, but in the end, if I have a result of a calculation that can only be addressed with a Variable, I'm stuck with it, as I can find no way to store a Variable to a field in a table ($VariableName).   Is there some way to store these Variables?

Thanks,

Bob</description>
		<content:encoded><![CDATA[<p>I have had a similar issue with variable that are available during a script, and allow for all sorts of data comparisons, but in the end, if I have a result of a calculation that can only be addressed with a Variable, I&#8217;m stuck with it, as I can find no way to store a Variable to a field in a table ($VariableName).   Is there some way to store these Variables?</p>
<p>Thanks,</p>
<p>Bob</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Geoff Coffey</title>
		<link>http://sixfriedrice.com/wp/filemaker-9-tip4-temporary-files/#comment-603</link>
		<dc:creator>Geoff Coffey</dc:creator>
		<pubDate>Tue, 25 Sep 2007 21:11:00 +0000</pubDate>
		<guid>http://sixfriedrice.com/wp/filemaker-9-tip4-temporary-files/#comment-603</guid>
		<description>@homer: I had the same misconception you had. I thought this temp folder was emptied on reboot, just like the &lt;code&gt;/tmp&lt;/code&gt; folder on a typical unix-ish system. But in my more recent testing, it does not actually empty automatically. Apparently it is our job to delete the file when we're done.

I have not discovered the FMTEMPFM thing you mention. If that works it is a great tip. I'll play with it and see what I discover.

Otherwise, it is possible to delete files in FileMaker without a plug-in. You just have to get an empty found set:

&lt;pre&gt;&lt;code&gt;
Show All Records
Show Omitted Only
&lt;/code&gt;&lt;/pre&gt;

Then do an export. When you do the export, if the file you target already exists it will be deleted. And since there's nothing to export, no new file will be created. This is a hack, and may certainly stop working in a future version of filemaker, so a sanctioned technique would be much better.

Thanks for the tip.</description>
		<content:encoded><![CDATA[<p>@homer: I had the same misconception you had. I thought this temp folder was emptied on reboot, just like the <code>/tmp</code> folder on a typical unix-ish system. But in my more recent testing, it does not actually empty automatically. Apparently it is our job to delete the file when we&#8217;re done.</p>
<p>I have not discovered the FMTEMPFM thing you mention. If that works it is a great tip. I&#8217;ll play with it and see what I discover.</p>
<p>Otherwise, it is possible to delete files in FileMaker without a plug-in. You just have to get an empty found set:</p>
<pre><code>
Show All Records
Show Omitted Only
</code></pre>
<p>Then do an export. When you do the export, if the file you target already exists it will be deleted. And since there&#8217;s nothing to export, no new file will be created. This is a hack, and may certainly stop working in a future version of filemaker, so a sanctioned technique would be much better.</p>
<p>Thanks for the tip.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Homer</title>
		<link>http://sixfriedrice.com/wp/filemaker-9-tip4-temporary-files/#comment-596</link>
		<dc:creator>Homer</dc:creator>
		<pubDate>Mon, 24 Sep 2007 20:38:58 +0000</pubDate>
		<guid>http://sixfriedrice.com/wp/filemaker-9-tip4-temporary-files/#comment-596</guid>
		<description>I've had some issues with the Get(TemporaryPath) Function.

It was my understanding that this dir was "temporary" meaning the documents I export to this dir would be deleted at shut down.  I have not found this to be the case.

In order to have files removed (and thats at FMP startup not shutdown), I have had to preface the filename with the string FMTEMPFM.  This seems to indicate to FM that this is a true temp file.

I haven't seen any documentation on any of this and was looking for additional insight.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve had some issues with the Get(TemporaryPath) Function.</p>
<p>It was my understanding that this dir was &#8220;temporary&#8221; meaning the documents I export to this dir would be deleted at shut down.  I have not found this to be the case.</p>
<p>In order to have files removed (and thats at FMP startup not shutdown), I have had to preface the filename with the string FMTEMPFM.  This seems to indicate to FM that this is a true temp file.</p>
<p>I haven&#8217;t seen any documentation on any of this and was looking for additional insight.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dom</title>
		<link>http://sixfriedrice.com/wp/filemaker-9-tip4-temporary-files/#comment-343</link>
		<dc:creator>Dom</dc:creator>
		<pubDate>Sat, 11 Aug 2007 07:53:07 +0000</pubDate>
		<guid>http://sixfriedrice.com/wp/filemaker-9-tip4-temporary-files/#comment-343</guid>
		<description>Thanks ! 

With the &lt;code&gt;GetAsText&lt;/code&gt; function it works perfectly

1 Table "files"
1 container field "container1"
1 container field "global_container"

and here is the script:

&lt;pre&gt;&lt;code&gt;
Allow User Abort [ Off ] 
Set Variable [ $file_name; Value:GetAsText ( files::container1 ) ] 
Set Variable [ $path; Value:Get ( TemporaryPath ) &#38; $file_name ] 
Export Field Contents [ files::container1; â€œ$pathâ€ ] 
Insert File [ Reference, files::global_container; â€œ$pathâ€ ]
Go to Field [ Select/perform ; files::global_container ]
&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Thanks ! </p>
<p>With the <code>GetAsText</code> function it works perfectly</p>
<p>1 Table &#8220;files&#8221;<br />
1 container field &#8220;container1&#8243;<br />
1 container field &#8220;global_container&#8221;</p>
<p>and here is the script:</p>
<pre><code>
Allow User Abort [ Off ]
Set Variable [ $file_name; Value:GetAsText ( files::container1 ) ]
Set Variable [ $path; Value:Get ( TemporaryPath ) &amp; $file_name ]
Export Field Contents [ files::container1; â€œ$pathâ€ ]
Insert File [ Reference, files::global_container; â€œ$pathâ€ ]
Go to Field [ Select/perform ; files::global_container ]
</code></pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Geoff Coffey</title>
		<link>http://sixfriedrice.com/wp/filemaker-9-tip4-temporary-files/#comment-321</link>
		<dc:creator>Geoff Coffey</dc:creator>
		<pubDate>Wed, 08 Aug 2007 12:59:14 +0000</pubDate>
		<guid>http://sixfriedrice.com/wp/filemaker-9-tip4-temporary-files/#comment-321</guid>
		<description>@dom: I'm going to apply two little-known calculation tricks to get your answer.

First, when you use a container field in a text-like way, and the field contains a file, you get the name of the original file. For example, if you have a container field called &lt;code&gt;Document&lt;/code&gt; and you make a calculated text field with this formula: &lt;code&gt;GetAsText(Document)&lt;/code&gt; you'll see the name of the original document in the field.

Second, the &lt;code&gt;Position&lt;/code&gt; function can search from the &lt;em&gt;end&lt;/em&gt; of a text value if you set the start to &lt;code&gt;-1&lt;/code&gt;

So here is a formula that gets the file extension of the file stored in a container field:

&lt;pre&gt;&lt;code&gt;
Let(
   name = GetAsText(Document);
   Middle(name; Position(name; "."; -1; 1) + 1; 99999)
)
&lt;/code&gt;&lt;/pre&gt;

This will only work if the file is &lt;em&gt;stored&lt;/em&gt; in the field. If you store only a reference to the file, you can use a similar technique. In your data viewer, use &lt;code&gt;GetAsText&lt;/code&gt; to see what FileMaker reports about the reference to the file, and write a calculation to parse it as appropriate.

Hope this helps.</description>
		<content:encoded><![CDATA[<p>@dom: I&#8217;m going to apply two little-known calculation tricks to get your answer.</p>
<p>First, when you use a container field in a text-like way, and the field contains a file, you get the name of the original file. For example, if you have a container field called <code>Document</code> and you make a calculated text field with this formula: <code>GetAsText(Document)</code> you&#8217;ll see the name of the original document in the field.</p>
<p>Second, the <code>Position</code> function can search from the <em>end</em> of a text value if you set the start to <code>-1</code></p>
<p>So here is a formula that gets the file extension of the file stored in a container field:</p>
<pre><code>
Let(
   name = GetAsText(Document);
   Middle(name; Position(name; "."; -1; 1) + 1; 99999)
)
</code></pre>
<p>This will only work if the file is <em>stored</em> in the field. If you store only a reference to the file, you can use a similar technique. In your data viewer, use <code>GetAsText</code> to see what FileMaker reports about the reference to the file, and write a calculation to parse it as appropriate.</p>
<p>Hope this helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dom</title>
		<link>http://sixfriedrice.com/wp/filemaker-9-tip4-temporary-files/#comment-315</link>
		<dc:creator>Dom</dc:creator>
		<pubDate>Tue, 07 Aug 2007 20:50:00 +0000</pubDate>
		<guid>http://sixfriedrice.com/wp/filemaker-9-tip4-temporary-files/#comment-315</guid>
		<description>Thanks for this tip, but how can I give to the temporary file name the same file extension of the file I wish to open. 

For example if I have several containers with different kind of files types (pdf, word, etc...) the temporary file should have the same file extension .pdf or .doc as the original file so that it opens in the right application.

Thanks in advance for your help.</description>
		<content:encoded><![CDATA[<p>Thanks for this tip, but how can I give to the temporary file name the same file extension of the file I wish to open. </p>
<p>For example if I have several containers with different kind of files types (pdf, word, etc&#8230;) the temporary file should have the same file extension .pdf or .doc as the original file so that it opens in the right application.</p>
<p>Thanks in advance for your help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: George D. Appel</title>
		<link>http://sixfriedrice.com/wp/filemaker-9-tip4-temporary-files/#comment-294</link>
		<dc:creator>George D. Appel</dc:creator>
		<pubDate>Sat, 04 Aug 2007 21:16:37 +0000</pubDate>
		<guid>http://sixfriedrice.com/wp/filemaker-9-tip4-temporary-files/#comment-294</guid>
		<description>Great idea!  However, I don't know what to use for "Insert File" in FMP 9 Advanced.

Thank you for your tips and help.</description>
		<content:encoded><![CDATA[<p>Great idea!  However, I don&#8217;t know what to use for &#8220;Insert File&#8221; in FMP 9 Advanced.</p>
<p>Thank you for your tips and help.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
