All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself
Peter peters. Al
HBAM2016AUG95
Pro 3.0
All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters.Co
pyright 1984-1997 Claris Corporation
All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters. All by himself Peter peters
. All by himself Peter peters. All by himself Peter peters. All by him
HBAM3016AUG95@
pan unexpected TCP/IP error (
AppleTalk is not enabled ( TCP/IP couldn't be initialized (:the manually set TCP/IP address is configured improperly (Jth
e TCP/IP address is already in use or an address could not be obtained (
; This file is created and used by FileMaker Pro for TCP/IP access.
; It should contain one IP address or host name per line.
; Lines starting with a semicolon are ignored.
FileMaker Hosts
Local Hosts
Specify Host...:FileMaker host name is limited to 32
1st Quarter
2nd Quarter
3rd Quarter
4th Quarte
Helvetica
Geneva
Pro 3.0 - 4.0F!
zondag
maandag
dinsdag
woensdag
donderdag
vrijdag
zaterdag
januari
februari
maart
april
augustus
september
oktober
november
december
1st Quarter
2nd Quarter
3rd Quarter
4th Quarter
12/7/97
textB
A Layout #1
A Layout #1B
Helvetica
Geneva
C+This file was created by the
Troi plug-in!D
Close File
Helvetica
Geneva
3A*test1234test1234test
test1234test1234test
files
folders
files
folders
Access to files
nd folders
The Troi File Plug-in is a very powerful tool for getting access to information outside the FileMaker database. Any files stored on the rest of the computer can be accessed through the functions of the plug-in. All from within FileMaker you can:
* get data out of files on the disk of the computer
* create files anywhere on the hard disk and put data from FileMaker fields into it
* manipulate files and folders on the disk, like creating/deleting/copyi
ng/moving
Getting started
The Troi File plug-in adds new functions to the standard functions that are available in FileMaker Pro. The functions added by a plug-in are called external functions. You use special syntax with external functions: External("function name", parameter) where function name is the name of an external function. The parameter is required, even if it's only "". Plug-ins don't work directly after installation. To access a plug-in function, you need to add the calls to
the function in a ScriptMaker Script. For example if you add the following script step to a script:
Set Field[myTextField, External("TrFile-GetContents", "C:\DataFiles\Report.txt")]
it will returns the contents of the file in the field myTextField.
Note that function names, like "TrFile-GetContents" are case sensitive.
Please take a close look at the included example files, as they provide a great starting point. From there you can move on, using the 42 functions of the plug-in as bu
ZDQilding blocks. Together they give you all the tools you need to access the disk.
--text for the log line ---
Get File DataB
1998-2000Troi Automatisering
go to: www.troi.com
Getting data in
Introduction
Getting data out
Manipulation
click to scroll
Buy Now!
Read Me
Function Overview
SFeature added after the 2.0 beta: setting the initial folder for selection dialogs!
Demo!
Get Data OutB
the contents of the file:
Clear Field
K%Getting File Data in
to FileMaker Pro
1-Simple Get Contents
1998-2000Troi Automatisering
go to: www.troi.com
You can get the contents of a (text) file in one step using the function: "TrFile-GetFileContents". This function will bring up a file selection dialog and returns the contents of the selected file.
wlIf you cancel $$-1 is returned. See the user guide and OSErrrs database for more information on error codes.
To Menu
<- Previous Sample
-> Next Sample
Read MeB
I'This file will be
created:
A FMP3 fileW
theFileSpec|
FileName
Creating and Deleting Files
To Menu
File Creation
File Deletion
1998-2000Troi Automatisering
go to: www.troi.com
Manipulate Files (Copy, Move)B
Troi File Plug-in
Troi File Plug-in is copyright 1998-2000 of Troi Automatisering. All rights reserved (April 3rd, 2000).
Thank you for your interest in the Troi File Plug-in. This FileMaker Pro
plug-in adds File and Folder Manipulation: save or read a field from or to a file. Other manipulations like deleting files, creating folders are also possible.
This cross-platform plug-in is compatible with Filemaker Pro 4 and 5 and enhances their functions. Finally you can do things you t
hought were still impossible to do with FileMaker Pro. Now you can create powerful databases by using this plug-in!
INSTALLATION INSTRUCTIONS
INSTALLING A (TROI) PLUG-IN FOR THE FIRST TIME.
-For Macintosh: put the file "Troi File Plug-in" from the folder "MacOS Plug-in" into the
"FileMaker Extensions" folder in the FileMaker Pro folder. If you have installed previous
versions of this plug-in, you must remove them.
-For Windows: put the file "trfile.fmx" from the directo
ry "Windows Plug-in" into the
"SYSTEM" subdirectory in the FileMaker Pro directory. If you have installed previous versions
of this plug-in, you must remove them.
You may want to install other plug-ins before proceeding. Then (re)start FileMaker Pro. The Troi
File Plug-in will display a dialog box, indicating that it is loading and showing the registration
status. You can now open the file "All File Examples.fp3" to see how to use the plug-in's functions.
There is al
so a Function overview in this file.
What Troi File Plug-in can do for you:
The File Manipulation functions make it possible to save the contents of a (text)field or global to a file. You may calculate a path name or let the user indicate a location on your disks through a Put (Save as...) dialog box. The reverse is also possible: have the user select a file and read it into a field. Additional functions let you query detailed information of a file: the size on disk, creation and modif
ication dates etc. Other manipulations include creation, deletion, copying and moving of files, and the creation of folders.
Who wrote it?
Troi File Plug-in was designed and implemented by Peter Baanen of Troi Automatisering <peter@troi.com>. You can also visit the Troi web site at: <http://www.troi.com/> for additional information.
Troi may also be reached by postal mail at:
Troi Automatisering
Vuurlaan 18
2408 NB Alphen a/d Rijn
The Netherlands
Fax: +31-172-470539
Where can I get t
he latest version and more information?
The latest versions of our software are available for downloading at our web site: <http://www.troi.com/>
Here you will also find late breaking information, company information, FileMaker tips and more. Our software will also be posted (with
a week delay) to info-mac (and its mirrors). Go to: <http://www.pht.com/info-mac> or <http://hyperarchive.lcs.mit.edu/HyperArchive.html>.
System Requirements
This software should be able to run on any machine
that is able to run FileMaker Pro 4.0 and 5. Of course you need a copy of FileMaker Pro, this should be a version 4.0v1 or later. This may be the US version or any other localization.
You can try-before-you-buy. This means that you are free and invited to test the plug-in 30 days before you pay. You may also make copies of the original and complete package (including this Read Me f
ile) and distribute it to customers, friends etc. However, you may not distribute a modified or licenced version.
Use Troi File Plug-in at your own risk:
Although Troi File Plug-in was tested carefully, we can not be responsible for any damages resulting from using this software. Also please try it out on a test database. Your system may be using an extension (unknown to us) that interferes with the proper functioning of Troi File Plug-in.
We like to hear feedback on the benefits and shor
tcomings of the plug-in. Please include the platform and operating system in your suggestions and comments.
What are the costs?
Troi File plug-in has the following pricing:
New licenses
1-24 users licenses (Mac OS): US$ 39 per user
1-24 users licenses (Windows): US$ 39 per user
25-99 user licenses (Mac and/or Windows): US$ 29 per user
100-999 user licenses (Mac and/or Windows): US$ 19 per user
1000 or more users licenses (Mac and/o
r Windows): US$ 9 per user
Developer license (Mac OS): US$ 149
Developer license (Windows): US$ 149
Developer license (Mac and Windows): US$ 249
Upgrades from previous versions
Previous license upgrade price
Single license (Mac OS): US$ 19 per user
Single license (Windows): US$ 19 per user
Site license (Mac OS): US$ 9 p
er user
Site license (Windows): US$ 9 per user
Worldwide license (Mac OS): US$ 9 per user
Worldwide license (Windows): US$ 9 per user
X-plat Developer license to X-platform Dev. license US$ 79
NOTE We no longer have a bundle price for Troi Dialog plug-in, Troi File plug-in and Troi Coding plug-in.
All Troi Plug-in are available for Macintosh and Windows. When ordering please indicate for which platform you ar
e ordering.
Special licences for developers of FileMaker Pro solutions are available. Also sub-licensing is possible. Please contact Troi for information about this. The plug-in works with FileMaker Pro Developer edition Note that it does not work with the FileMaker Pro SDK version 3.0.
How to pay?
Paying for a license is easy. There are 3 ways to pay:
1) Pay via Kagi Online at <http://order.kagi.com/?5i>
2) Pay via Waves in Motion online at <http://www.wmotion.com/>
3) Pay Troi Automat
isering directly (only for users in the Netherlands)
1) Pay via Kagi Online
Kagi is a trustworthy payment service which handles payment for a lot of users and software authors . As of end of Nov 1997 Kagi already processed 338505 payments from more than 7000 authors.
Kagi has a web page where you can pay via Credit Card. Point your web browser at <http://order.kagi.com/?5i> Fill in the form and follow the instructions. KAGI can also process checks and purchase orders. If you want to pay
, but don't have a credit card please email us at sales@troi.com for more options.
2) Pay via Waves in Motion
This Troi plug-in is also distributed by Waves in Motion. Waves in Motion has a web page where you can pay via Credit Card and directly download a full working version after payment. Point your web browser at <http://www.wmotion.com/Products.html>. Fill in the form and follow the instructions.
3) Pay Troi Automatisering directly
(only for users in The Netherlands)
Please use o
ption 1 (Pay Kagi) if you live outside the Netherlands.
But if you live in The Netherlands you can pay as follows:
For prices in guilder use the course of the 1 dollar = fl 2,20. The guilder pricese are the same price as above x 2,20 + BTW.
So for example a single user license costs $39. In guilder this becomes:
39 x 2,20 = fl 85,80+ 15,02 BTW = fl 100,82.
Please pay the appropriate amount to:
Bank Name: Postbank NV, Amsterdam
Postgiro Account number: 72.29.209
Troi Automatisering
Vuurlaan 18
2408 NB Alphen a/d Rijn
The Netherlands
To indicate for which software you are paying, add a remark like this:
Troi File Plug-in Macintosh x number of copies
and/or
Troi File Plug-in Windows x number of copies
Please e-mail your payment details to sales@troi.com as well, so we can match it with you.
Protection and Unlocking the application
Troi File Plug-in has a protection scheme. After you pay Troi Automatisering will tell you how to indicate to Troi File Plug-in th
at you have paid the licence fee.
If you do not have an e-mail address, please enter your complete postal address and remember, we do not know what country you live in so please enter that into the postal address also.
After you've supplied the payment data the following is changed:
- the
unlicenced
warning is replaced by your name.
- the flash screen that shows at the first time the plug-in is used is removed. Of course also the delay (which is longer after 30 days of use) will be re
If you find a bug, please report this by e-mail: peter@troi.nl. If you have any comments or other functions that you think need to be added, please notify us! We have a lot of ideas for this plug-in, so be sure to check our web site for new plug-ins and improved versions.
And please pay for software you keep using, so that the wish list gets
reality.
Versions
2.0 (03-Apr-2000)
- Added extra parameter for the initial Directory. to the functions "ContentsDialog", "Get FileSpec Dialog" and "Save FileSpec Dialog". Now you can specify where the selection dialog starts.
where a dialog message would appear with the text: "Couldn't close search handle".
1.5 (24-Feb-2000)
- Added User Guide
- Mac: Fixed a rare bug where the full path was not correctly handled. If you had 2 disksnames starting with the same beginning, like "KES" and "KES Work" CopyFile and MoveFile etc could return an errors.
1.2.2.1 (12-Mar-99)
-Mac: added code to bring the Finder to front when launching a file, to be able to show dialogs like "The document
could not be opened, be
cause the application program that created it could not be found."
1.2.1 (10-Jan-99)
- added a built-in 'register function' for developers of runtimes.
- added the multi-import sample.
- fixed a bug with CreateFile on Windows. If the file exists the CreateFile now returns error code $$-48 (Duplicate FileName). In this situation also on Mac $$-48 is returned (was $$-1)
- added more example files (multi-image import, multi HTML export)
1.2 (03-Jul-98)
- clearer errorcodes returned by TrFil
e-Launch function.
- added TrFile-FolderList function
- added TrFile-Launch function
- removed the startup flash screen. Now a flash screen is shown the first time the plug-in functionality is used.
This flash screen is removed after payment of the licence fee.
- added example demonstrating Multiple import and export.
- added example demonstrating Multiple creation using PDFWriter.
- improved handling of FSSpec to FullPath.
1.1 (29-4-98)
- added create folder
- added find folder
- added
file copy and move
- file copy now returns an errorcode if destination file exists
- added partial read and appendToFile
- added Multiple file export demonstration
- split into 3 separate plugins: Troi Dialog Plug-in, Troi Coding Plug-in and Troi File Plug-in
1.0 (29-1-98) First release
- fixed a bug on 68k machines which disposed of a pointer improperly.
Thanks for supporting our software,
Peter Baanen
To MenuE
PrintF
File Plug-in Read Me
Append To FileB
source FileSpec
Manipulate Files
q File Copy
r File Move
destination FileSpec
result
wA>Warning:
This is a powerful feature. Be careful what you do!
x<returns 0 if ok
returns $$+errorcode if something went wrong
To Menu
Multi Export with Filenames
1998-2000Troi Automatisering
go to: www.troi.com
TIP You can also use the TrFile-Move function for renaming a file, just 'move' the source file inside the same folder to the new name.
Folder ManipulationB
theFileSpec|
FileName
AppendToFile
To Menu
1- Specify The File
2-Append a line
gErrorCode
1998-2000Troi Automatisering
go to: www.troi.com
_gAppendLogText
O"change the text below if you want
This example will create a file. After you create the file you can add lines to this file. Here we use it as a way to log data.
dNOTE 1 You can write any ASCII character (0-255) to disk. This means that you can create any file you like, not just text files.
NOTE 2 AppendToFile opens the file and closes the file again. So after the function has executed you dont have to close it. This also means that is it more efficient to write larger strings than only a few characters per call.
LaunchB
theFileSpec|
Folder Name
Folder Manipulation
To Menu
Folder Creation
Find Folder
error code
PRFolders is a Macintosh term. On Windows the term (sub)directory
is used for this.
1998-2000Troi Automatisering
go to: www.troi.com
Multi ExportB
the FileSpec
Launch
To Menu
1-Select File
2-Launch it!
returned ErrorCode
With this function you can open files in the application that has registered it.
Example1:
a text file "ReadMe.txt" will be opened by NotePad (Win) or SimpleText (Mac)
Example2:
a pdf file "userguide.pdf" will be opened by Acrobat reader.
UtNOTES:
- on Windows you can also open directories.
- on Windows if the file is already open it will open it again.
Possible Returned error codes
$$-35 = No such volume (Wrong disk name or not mounted).
$$-43 = File not found.
$$-50 = Parameter error.
$$-120 = Directory not found.
1998-2000Troi Automatisering
go to: www.troi.com
FolderListB
export FileSpec
Export to Multiple files*
q Export 1x
destination Folder
step 1
Locate the Export file
step 2
This example creates an export file called
TrExport.tab
in the folder of this FMP-file. You might want to change that: it
s in the script
Export Data
!A) You have to do this only ONCE:
Please find the exported file.
Create a destination folder
step 3
TSpecify a destination folder.
You can also type in a full path to the folder below.
Do Multi Export
,B) When you want to export, run this script:
ABEE>> files are exported with the number of records in the name:
Example: EXP32.TAB
destinat. exp.filename
gErrorCode
By default files are not overwritten. Use this checkbox if you want to overwrite existing files. (See the script for how to do this with the TrFile-DeleFile function.)
overwrite
Files?
TError -48 (Mac) or 80 (Win) = files exists. Set the overwrite checkbox to overwrite.
U*This technique can also be used for Importing records or images from multiple files.
How does it work?
1998-2000Troi Automatisering
go to: www.troi.com
To Menu
FolderList scriptedB
W$switches, determining what is listed|
folder path
@A%FolderList
(using field calculation)
To Menu
K(below the command used to get this list:
Type a full path
PA8terminology:
Mac Windows
folder directory
alias shortcut
FolderList calculation
# of items found
]Dthese 2 switches have the same effect:
show also aliases (shortcuts)
list all files
_%show also invisible files and folders
`FWindows: show also directories . and ..
Mac OS: this switch is ignored
list all folders (directories)
Change switches
To Scripted Version
1998-2000Troi Automatisering
go to: www.troi.com
SearchB
folder path
To Menu
s$switches, determining what is listed
uDthese 2 switches have the same effect:
show also aliases (shortcuts)
list all files
w%show also invisible files and folders
x)(Win only) show also directories . and ..
list all folders (directories)
command used
|A8terminology:
Mac Windows
folder directory
alias shortcut
gFolderList
Get FolderList
To Field Version
2) Click Here
#1) Type a full path
+ set switches
A%FolderList
(using field calculation)
1998-2000Troi Automatisering
go to: www.troi.com
Multi PDF PrintB
search for files with name
Search
To Menu
o$switches, determining what is listed
qDthese 2 switches have the same effect:
show also aliases (shortcuts)
list all files
s%show also invisible files and folders
search for the exact filename
list all folders (directories)
command used
xA8terminology:
Mac Windows
folder directory
alias shortcut
z Search Results (<<
ABFH>> found)
Search
} 4) Click Here to start searching
2) Type a filename
volume name
ABFI>>
Possible Returned error codes
$$-35 = No such volume (Wrong disk name or not mounted).
$$-43 = File not found.
$$-50 = Parameter error.
$$-120 = Directory not found.
3) Set switches
1) Select the disk to search
1998-2000Troi Automatisering
go to: www.troi.com
Data inB
PDF FileSpec
Print to Multiple PDFs
Print 1x
destination Folder
step 1
Locate the Printed file
step 2
You need PDFWriter as printer installed. If so this example creates an pdf file called
untitled
on the desktop folder. The script doing this is called
Print one PDF"
!A) You have to do this only ONCE:
Please find the PDF file.
Create a destination folder
step 3
TSpecify a destination folder.
You can also type in a full path to the folder below.
Do Multi PDFs
,B) When you want to export, run this script:
T10 PDF files are printed with the number of records in the name:
Example: Demo32.PDF
destinat. exp.filename
gErrorCode
By default files are not overwritten. Use this checkbox if you want to overwrite existing files. (See the script for how to do this with the TrFile-DeleFile function.
overwrite
Files?
TError -48 (Mac) or 80 (Win) = files exists. Set the overwrite checkbox to overwrite.
U*This technique can also be used for Importing records or images from multiple files.
1998-2000Troi Automatisering
go to: www.troi.com
To Menu
How does it work?
Data outB
1998-2000Troi Automatisering
go to: www.troi.com
Getting data in
Getting data out
Manipulation
Introduction
Buy Now!
Read Me
Function Overview
Searching for Files on Disk
Getting File Data in FMP Demo
This example shows how to let a user select a file. Then data from this file is put into a FileMaker field. Also shows variations of this, like getting a part of a file and other information like date and size of the file.
Listing Files and Disk info
Selecting a Folder
Get File Attributes Demo
Get Path To CurrentFile Demo
Multi image import
3<This example shows how to search for files on the hard disk.
4?This example shows how to list the files that are in a folder.
GTHETIMEMODIFIED
This example shows how to get (and set) the attributes of a file. Allows you to change read-only attribute of files from a CD-ROM.
7DThis example shows how to get the path of the current database file.
8zThis example shows how to let a user select a folder. The path of the
selected folder can be used by the other functions.
93You can also batch import images all in one script.
version!
ManipulationB
1998-2000Troi Automatisering
go to: www.troi.com
Getting data in
Manipulation
Introduction
Getting data out
Multi Export with Filenames
Multi PDF Printing
Buy Now!
Read Me
Function Overview
To be able to get data out of filemaker, this plug-in has functions that can create a file and fill it with any data you want. This example shows how to let a user select a file in a save dialog box. Then data from a FileMaker field is put into this file.
Creating Files
dThis example shows how to export in batch. Multiple Export files with TAB separated data are created
4This example shows how to create multiple PDF files.
Append to file
"AThis example shows how to add data to a file, one line at a time.
Export multiple HTML files
$JThis example shows how the File Plug-in can create HTML files in a batch.
Convert To/From FM Text
This example shows how convert text from a file correctly converted to and from the internal FileMaker format. Also useful when getting data in FileMaker.
version!
A Have Fun!
Get File Data (part2)B
1998-2000Troi Automatisering
go to: www.troi.com
Getting data in
Getting data out
Introduction
Manipulation
Buy Now!
Read Me
Function Overview
~This example shows how to create copies of files on disk. You can also move files around on disk (and rename them optionally).
Launch File from FMP
Copy and Move Files
SThis example shows how to can open files in the application that has registered it.
Folder Manipulation Demo
=This example shows how to create folders and search for them.
Substitute in Files
Set File Attributes Demo
This example shows how to get and set the attributes of a file. Allows you to change read-only attribute of files from a CD-ROM.
CThis example shows how to substitute characters in a file on disk.
Disable/Enable Plug-in Demo
The powerful functions might be a security concern. This example shows how to disable (and enable) the plug-in's functions with the help of a password.
Get File Data (part3)B
theFileSpec
1998-2000Troi Automatisering
go to: www.troi.com
file contents
OCP OE
xA/Getting File Data in
to FileMaker Pro (part 2)
2-Get a FileSpec
Clear Field
To Menu
You can also ask the File Specification (FileSpec) of a file with the function "TrFile-Get FileSpec Dialog". This function will bring up a file selection dialog and returns the FileSpec of the selected file.
<- Previous Sample
mIf you cancel $$-1 is returned. See the user guide and OSErrrs database for more information on error codes.
3-Get data in!
4-Get a part of the contents
7With the FileSpec you can get the contents of the file.
=Alternatively you can get a part of the contents of the file:
-> Next Sample
how does this workB
6-Filtering files
theFileSpec
1998-2000Troi Automatisering
go to: www.troi.com
9A/Getting File Data in
to FileMaker Pro (part 3)
Change the FileSpec
>,Click here if you want a different FileSpec.
@6With the FileSpec you can get a lot of properties too:
5-Get file properties
Size on disk
Creation
Modification
I Data Size
Resource Size
bytes
bytes
DateTimeCreated
DateTimeModified
Creator
Y FileType
Z Mac only
To Menu
<- Previous Sample
-> Next Sample
Clear Fields
feature since 2.0 beta!
7-Setting Initial Folder
Open file
Set all globals
Quit button dialog
----- Navigation ------
To Menu
To Function Overview
To Introduction TAB
To Getting Data In TAB
To Getting data Out TAB
4To Manipulating Data (Files And Folders) on Disk TAB
----- General ------
Check FILE plug-in
Check for NO Troi FM plug-in
1998-2000Troi AutomatiseringB
go to: www.troi.comC
To MenuD
backE
The idea is to let FileMaker do the export to a fixed file first and then copy that exported file to the desired location, giving it the wanted name at the same time. This can be done with the Troi file plug-in in a script by the following steps:F
How does Multi im/export work?H
FileMaker Limitation
FileMaker has the limitation that in a script it can only export to a fixed file, or ask the user for a file name. You can not specify the file by a calculation in a script. The same limitations apply when importing records or images.J'The way around this limitation (export)
Export Records [Restore, No dialog, TrExport.tab] export to a fixed location
Set Field [gDestExportFSSpec, gTheFileSpec & "EXP" & Stat] calculate the filepath of the destination
Set Field [gErrorCode, External("TrFile-CopyFile";
gExportFSSpec & "|" &gDestExportFSSpec)] copy the file to the destination
Exit Loop If [...]
End Loop
LGThe sample scripts are a bit more elaborated and do error checking etc.
hFor import the idea is this almost the same: First copy the file to be imported to a fixed file. Then let FileMaker do the import of this fixed file. This works with importing records, pictures and movies. See the sample scripts for more details. One limitation remains: at this moment we know of no way to do a multi-import of pictures by storing a reference.
N'The way around this limitation (import)
Helvetica
Geneva
Arial
Times New Roman
Monaco
Courier
Times
Futura
Courier New
Palatino
----- Get Data in ------
Simple Get Contents Dialog
Get FileSpec Dialog
Get File Contents
Get File Properties
Partial Get File Contents
File Manip: Filtering Files
Clear File Properties Fields
----- Getting Data out ------
Create a file
.'Ask for a filename for the user to Save
Append to a file (start)
Append line to a file
----- Manipulation ------
6,File Manipulation: Toggle FSSpec / Full Path
8&File Manipulation: FSSpec to Full Path
:&File Manipulation: Full Path to FSSpec
Folder Manip: Create a Folder
> File Manipulation: Delete a file
File Manip: Copy a file
File Manip: Move a file
D+Folder Manip: Create a File with FindFolder
Clear File Spec
----- Multi Export ------
To Multi export
Export Data
Exp: Locate Export file
Exp: Locate destination folder
Exp: Do Multi export
Exp: Check Folder Spec
----- Multi Image Import ------
Import Image Data
imp: Do Multi Image Import
imp: goto right repetition
Imp: Locate import file
Imp: Locate first image
Imp: Clear fields
----- FolderList ------
FolderList
FolderList (Select Folder)
To FolderList Demo
l To FolderList (Scripted Version)
Launch File
Select File
----- Multi PDFs ------
Print one PDF
Exp: Locate PDF file
Do Multi PDFs
----- Search ------
| Do Search
----- Documentation etc ------
Print Function Specs
Copy Parameters
WWW: Goto web site: www.troi.com
WWW: Order via web site
Print this record
BeepBeep
----- Troi Test scripts ------
TEST: FindFolder
'TEST LOOP: File Manip: Append to a file
TEST Search Loop
"File Manipulation: Get Folder Spec
--- Navigation To: ---
To Get File Data in FMP
To Search Demo
To Searching for Files on Disk
%To Listing Files and Disk information
To SelectFolder
To SelectFile
To Attributes Demo
To Get Self Demo
To Getting data out
To Append to a file
To Multi Import v3
To HTML Demo
To Manipulation Demo
To Multi PDF Printing
To Substitute Demo
To Launch
To Disable/Enable Demo
To ConverText Demo
To Folder Manipulation
To Menu
Check FILE plug-in
Get FileSpec Dialog
Cancel
To get the File Specification of any file, use the function:
A4Important: ALWAYS check if the plug-in is available!B)Check if this is FileMaker 4.0 or higher.CQ
1)) < 4
Canceld
This file requires FileMaker 4.0 or higherE/Check if the correct Troi Plug-in is available.F
|("TrFile-Version"
"")
17 ) <> "Troi File Plug-in"
TrFile-Version
Troi File Plug-in
) = 1
Canceld
Troi File Plug-in not found. Please put the Troi File Plug-in into the Extensions folder inside the FileMaker folder.
Also enable all the plug-ins under the application preferences.
Canceld
Troi File Plug-in not found. Please put the Troi File Plug-in into the SYSTEM directory inside the FileMaker directory.
Also enable all the plug-ins under the application preferences.
A File Manipulation: Delete a file
A+Specify a file and puts this on the desktopBN
|("TrFile-SetDefaultType"
TrFile-SetDefaultType
|("TrFile-Get FileSpec Dialog"
"Select a file to DELETE
WARNING: Deletion cannot be undone.")
TrFile-Get FileSpec Dialog
;Select a file to DELETE
WARNING: Deletion cannot be undone.|D;
2 ) = "$$"
User pressed cancel
A+Specify a file and puts this on the desktopB;
2 )
"$$"
|("TrFile-SetDefaultFileSpec"
TrFile-SetDefaultFileSpec
|("TrFile-SetDefaultCreator"
"FMP3")
TrFile-SetDefaultCreator
FMP3|EV
|("TrFile-SetDefaultType"
"FMP3")
TrFile-SetDefaultType
FMP3|FJ
|("TrFile-CreateFile"
TrFile-CreateFile
H$File was created ok. (errorcode = 0)IK
|("TrFile-SetContents"
TrFile-SetContents
|("TrDl-Version"
"") = ""
TrDl-Version
<R<<8<98%8! !
Cancel
!;<R<R8;98%8%
;NThe file was created. This example file is actually a real Filemaker file!"
|("TrDl-DoDialog"
"The file """ &
&""" was created. This example file is actually a real Filemaker file!")
TrDl-DoDialog
The file "
C" was created. This example file is actually a real Filemaker file!
<R<<8<98%8! !
Cancel
!;<R<R8;98%8%
;NThe file could not be created.
Check if it already exists.
Set all globals
|("Troi-Set Default Separator"
"|")
Troi-Set Default Separator
OKns of thi
Pug-in, you must re
Cancelem.
(Re)start FileMaker Pr
. The Troi FM plug-in will displaDeletion was canceled.G
OKns of thi
Pug-in, you must re
Cancelem.
(Re)start FileMaker Pr
. The Troi FM plug-in will displaAre you sure you want to delete this file?H+
) = 1
|("TrFile-DeleteFile"
TrFile-DeleteFile
K!File was deleted. (errorcode = 0)L
OKns of thi
Pug-in, you must re
Cancelem.
(Re)start FileMaker Pr
. The Troi FM plug-in will displaThe file has been deleted.M
OKns of thi
Pug-in, you must re
Cancelem.
(Re)start FileMaker Pr
. The Troi FM plug-in will displaThe file ould not be deleted.N
OKns of thi
Pug-in, you must re
Cancelem.
(Re)start FileMaker Pr
. The Troi FM plug-in will displaThe file was not deleted.
A Open file
) = 2
Simple Get Contents Dialog
Cancel
"You can import a TEXT file in one step using the function:
External ("TrFile-GetFileContents" ; "<prompt>")
The following dialog lets you select a file.BN
|("TrFile-ContentsDialog"
TrFile-ContentsDialog
"A&File Manipulation: FSSpec to Full Path
|("TrFile-FileSpec To FullPath"
TrFile-FileSpec To FullPath
) = 1
"files
folders"
files
foldersV0
"files
folders"
files
foldersW
#A&File Manipulation: Full Path to FSSpec
|("TrFile-FullPath To FileSpec"
TrFile-FullPath To FileSpec
File Manip: Filtering Files
Cancel
You can get a "TrFile-Get FileSpec Dialog" function to display all files (No filtering).CN
|("TrFile-SetDefaultType"
TrFile-SetDefaultType
Get File Contents
= ""
Cancel
Get a fileSpec first.C;
2 ) <>"$$"
|("TrFile-GetContents"
TrFile-GetContents
Cancel
You pressed cancel.
When you cancel a result "$$-1" is returned. In your scripts you should test for this result.
+A,File Manipulation: Toggle FSSpec / Full Path
" = ""
|("TrFile-Get FileSpec Dialog"
"Please choose a file:")
TrFile-Get FileSpec Dialog
Please choose a file:|
Cancel
The Macintosh lets you distinguish files by their file type. To list only specific files in a "Get FileSpec Dialog" function, you can set one or more filters by using the function: External ("TrFile-SetDefaultType" ; "<TYPE list>")
Cancel
The following example lets you select a file of type 'FMP3' and 'TEXT'. If you don't see any files in the current folder, browse to a folder where you find FileMaker Pro files and/or text files.G^
|("TrFile-SetDefaultType"
"FMP3TEXT")
TrFile-SetDefaultType
FMP3TEXT|
|("TrFile-Get FileSpec Dialog"
"Select a FileMaker file or a TEXT file:")
TrFile-Get FileSpec Dialog
'Select a FileMaker file or a TEXT file:|I
Reset the default type. JOIf not specified the type 'TEXT' is used with the function "TrFile-CreateFile"KV
|("TrFile-SetDefaultType"
"TEXT")
TrFile-SetDefaultType
TEXT|
,A WWW: Goto web site: www.troi.com
Cancel
Do you want to connect to Troi's web site?B+
) = 1
http://www.troi.com/
Button 2
Clear File Spec
Cancel
Maximize
OKncel
PageDo you want to erase all file spec information?B+
) = 2
Quit button dialog
"Full Path"
Full PathC
Print Function Specs
) < 601
Copy Parameters
Cancel
Do you want to copy the parameters?B+
) = 1
----- Get Data in ------
----- General ------
----- Documentation etc ------
File Manip: Copy a file
|("Troi-Version"
"")
15 ) = "Troi FM Plug-in"
Troi-Version
Troi FM Plug-in
|("Troi-DoDialog"
"Do you want to quit the FileMaker application as well?|OK|No||Cancel")
Troi-DoDialog
DDo you want to quit the FileMaker application as well?|OK|No||Cancel|C
OK1F1F1F1F1
F1F1F1F1F1F1F1F1F1
Noncel1F1F1F1F1F1F1F1F1F1F1F1F1F1
Cancel1F1F1F1F1F1F1F1F1F1F1F1F1F1Do you want to quit the FileMaker application as well?D+
) = 1
) = 2
File Manip: Move a file
|("TrFile-Get FileSpec Dialog"
"Specify a file to move to a diferent place:")
TrFile-Get FileSpec Dialog
+Specify a file to move to a diferent place:|B;
2 ) = "$$"
|("TrFile-Save FileSpec Dialog"
"Where should I move it?")
TrFile-Save FileSpec Dialog
Where should I move it?|D;
2 ) = "$$"
|("TrFile-MoveFile"
& "|" &
TrFile-MoveFile
WWW: Order via web site
Get the source fileB
|("TrFile-Get FileSpec Dialog"
"Specify a file to copy:")
TrFile-Get FileSpec Dialog
Specify a file to copy:|C;
2 ) = "$$"
|("TrFile-FileSpec To FullPath"
TrFile-FileSpec To FullPath
Get the destinationF
|("TrFile-Save FileSpec Dialog"
"Where should I save it?")
TrFile-Save FileSpec Dialog
Where should I save it?|G;
2 ) = "$$"
Here is the copying done:IZ
|("TrFile-CopyFile"
& "|" &
TrFile-CopyFile
|("TrFile-FileSpec To FullPath"
TrFile-FileSpec To FullPath
Print this record
BeepBeep
Append to a file (start)
|("TrFile-Save FileSpec Dialog"
"Where should I create a file?|Test.txt")
TrFile-Save FileSpec Dialog
&Where should I create a file?|Test.txt|B;
2 )
"$$"
Cancel
This will connect you to:
http://www.troi.com/software/order.htmlB+
) = 1
'http://www.troi.com/software/order.html.cgi?5iP
Button 2
Append line to a file
A+Specify a file and puts this on the desktopB!
= ""
Cancel
Specify a File first.D
|("TrFile-AppendContents"
"This line was written at: " &
)) & " " &
)) & " " &
TrFile-AppendContents
This line was written at:
<> 0
Cancel
An error occurred.
To Append to a file
|("TrFile-SetDefaultFileSpec"
TrFile-SetDefaultFileSpec
|("TrFile-SetDefaultCreator"
"ttxt")
TrFile-SetDefaultCreator
ttxt|EV
|("TrFile-SetDefaultType"
"TEXT")
TrFile-SetDefaultType
TEXT|FJ
|("TrFile-CreateFile"
TrFile-CreateFile
H$File was created ok. (errorcode = 0)I
OK8C4 Title
WORF
Cancel FMP3 dW data #259072
2 Title_fp3- WORF The empty file was created. Add lines to it by clicking on the "Append a line" button.J
OK8C4 Title
WORF
Cancel FMP3 dW data #259072
2 Title_fp3- WORF The file could not be created, it might already exists. Be sure you want to append to this file.Kd
|("Troi-DoDialog"
"You pressed cancel.")
Troi-DoDialog
You pressed cancel.|
WA'TEST LOOP: File Manip: Append to a file
A+Specify a file and puts this on the desktopB!
= ""
Cancel
Specify a File first.D
|("TrFile-AppendContents"
"This part was written at: " &
)) &
TrFile-AppendContents
This part was written at:
<> 0
Cancel
An error occurred.
Partial Get File Contents
Folder Manip: Create a Folder
A-Specify a folder and puts this on the desktopB
|("TrFile-Save FileSpec Dialog"
"Where should I create a folder?|DemoFolder")
TrFile-Save FileSpec Dialog
*Where should I create a folder?|DemoFolder|C;
2 )
"$$"
|("TrFile-CreateFolder"
TrFile-CreateFolder
F$File was created ok. (errorcode = 0)G}
OK
pRF FNDR dw
Cancel631000
1DC0 Apple Guide
WORF INIT dw dataThe folder was created.
|("TrFile-Get FileSpec Dialog"
"Please select a file first:")
TrFile-Get FileSpec Dialog
Please select a file first:|B;
2 )
"$$"
OKsrc #28
2808 Web Compani
Cancel WORF FMXT dw da
a #334062
2866 Web Companion First we read from the 5th character, with a length of 6 characters.D_
|("TrFile-GetContents"
& "|5 |6 ")
TrFile-GetContents
|5 |6
OKsrc #28
2808 Web Compani
Cancel WORF FMXT dw da
a #334062
2866 Web Companion Now we read 30 characters from the 10th character.
|("TrFile-GetContents"
& "|10|30")
TrFile-GetContents
|10|30
OKsrc #28
2808 Web Compani
Cancel WORF FMXT dw da
a #334062
2866 Web Companion Now we read all from the 10th character.H]
|("TrFile-GetContents"
& "|10|0")
TrFile-GetContents
|10|0
OKsrc #28
2808 Web Compani
Cancel WORF FMXT dw da
a #334062
2866 Web Companion If you read from beyond the end of the file errorcode $$-39 is returned.Jg
|("TrFile-GetContents"
& "|200000|10")
TrFile-GetContents
|200000|10
OKsrc #28
2808 Web Compani
Cancel WORF FMXT dw da
a #334062
2866 Web Companion You pressed cancel.
When you cancel a result ""$$-1"" is returned. In your scripts you should test for this result.
dA+Folder Manip: Create a File with FindFolder
A-Specify a folder and puts this on the desktop
OK
pRF FNDR dw
Cancel631000
1DC0 Apple Guide
WORF INIT dw dataYou can find special folders (directories) by using the function: "TrFile-FindFolder". You can find the system folder, preferences folder, root folder and others. In this example we first find the Desktop Folder.CT
|("TrFile-FindFolder"
"desktop")
TrFile-FindFolder
desktop|
OK
pRF FNDR dw
Cancel631000
1DC0 Apple Guide
WORF INIT dw dataThe folder was could not be created.
Check if it already exists.Id
|("Troi-DoDialog"
"You pressed cancel.")
Troi-DoDialog
You pressed cancel.|
TEST: FindFolder
A(TEST for using all FindFolder functions.
2 )
"$$"
OK
pRF FNDR dw
Cancel631000
1DC0 Apple Guide
WORF INIT dw dataThe Desktop Folder is found. Now we append the name of a file, "demofile.txt" and this is used to create a new file on the desktop.F\
|("TrFile-SetDefaultCreator"
"ttxt")
TrFile-SetDefaultCreator
ttxt|GV
|("TrFile-SetDefaultType"
"TEXT")
TrFile-SetDefaultType
TEXT|H9
& "demofile.txt"
demofile.txt
|("TrFile-CreateFile"
TrFile-CreateFile
K$file was created ok. (errorcode = 0)L
OK
pRF FNDR dw
Cancel631000
1DC0 Apple Guide
WORF INIT dw dataThe (empty) file "demofile.txt" was created on the desktop.
OK
pRF FNDR dw
Cancel631000
1DC0 Apple Guide
WORF INIT dw dataThe (empty) file "demofile.txt" could not be created on the desktop.
Check if it already exists.
Check for NO Troi FM plug-in
A4Important: ALWAYS check if the plug-in is available!B)Check if this is FileMaker 4.0 or higher.Cy
|("Troi-Version"
"")
15 ) = "Troi FM Plug-in"
Troi-Version
Troi FM Plug-in
) = 1
Canceld
Troi FM Plug-in is still installed, so new plug-in features won't be enabled.
Please remove the Troi FM Plug-in from the Extensions folder inside the FileMaker folder.
|("TrFile-FindFolder"
"desktop")
TrFile-FindFolder
desktop|Ca
|("TrFile-CreateFile"
&"DeleteMe")
TrFile-CreateFile
DeleteMe
|("TrFile-FindFolder"
"system")
TrFile-FindFolder
system|Fa
|("TrFile-CreateFile"
&"DeleteMe")
TrFile-CreateFile
DeleteMe
|("TrFile-FindFolder"
"trash")
TrFile-FindFolder
trash|Ia
|("TrFile-CreateFile"
&"DeleteMe")
TrFile-CreateFile
DeleteMe
|("TrFile-FindFolder"
"shutdown")
TrFile-FindFolder
shutdown|La
|("TrFile-CreateFile"
&"DeleteMe")
TrFile-CreateFile
DeleteMe
|("TrFile-FindFolder"
"applemenu")
TrFile-FindFolder
applemenu|
|("TrFile-CreateFile"
&"DeleteMe")
TrFile-CreateFile
DeleteMe
|("TrFile-FindFolder"
"controlpanels")
TrFile-FindFolder
controlpanels|Ra
|("TrFile-CreateFile"
&"DeleteMe")
TrFile-CreateFile
DeleteMe
|("TrFile-FindFolder"
"extensions")
TrFile-FindFolder
extensions|Ua
|("TrFile-CreateFile"
&"DeleteMe")
TrFile-CreateFile
DeleteMe
|("TrFile-FindFolder"
"preferences")
TrFile-FindFolder
preferences|Xa
|("TrFile-CreateFile"
&"DeleteMe")
TrFile-CreateFile
DeleteMe
|("TrFile-FindFolder"
"temporary")
TrFile-FindFolder
temporary|[a
|("TrFile-CreateFile"
&"DeleteMe")
TrFile-CreateFile
DeleteMe
|("TrFile-FindFolder"
"root")
TrFile-FindFolder
root|^a
|("TrFile-CreateFile"
&"DeleteMe")
TrFile-CreateFile
DeleteMe
Select File
|("TrFile-SetDefaultType"
TrFile-SetDefaultType
|("TrFile-Get FileSpec Dialog"
"Please select a file:")
TrFile-Get FileSpec Dialog
Please select a file:|C:
2) <>"$$"
Launch File
= ""
Cancel
Please select a file to launch first.CA
|("TrFile-Launch"
TrFile-Launch
Exp: Do Multi export
Canceld
Troi FM Plug-in is still installed, so new plug-in features won't be enabled.
Please remove the Troi FM Plug-in from the SYSTEM directory inside the FileMaker directory.
Export Data
Exp: Locate Export file
|("TrFile-Get FileSpec Dialog"
"Give a file to copy")
TrFile-Get FileSpec Dialog
Give a file to copy|B]
|("TrFile-FileSpec To FullPath"
TrFile-FileSpec To FullPath
Exp: Locate destination folder
Exp: Check Folder Spec
) = 1
B8if on Mac add a colon ":" to the full path, if not thereC^
1) <> ":"
D8if on Win add a colon "\" to the full path, if not there
& "EXP" &
) & ".TAB"
F = "Yes"
|("TrFile-DeleteFile"
TrFile-DeleteFile
|("TrFile-CopyFile"
C & "|" &
TrFile-CopyFile
<> 0
Export
Cancelh
Replace
An Error occured. See the layout for an explantion of errors.G+
) = 1
To Multi export
Import Image Data
imp: Do Multi Image Import
"biff"
64000
-1) -1) & "biff" &
) & ".gif"
|("TrFile-DeleteFile"
TrFile-DeleteFile
1) <> "\"
imp: goto right repetition
A(gNumber has the repetition number in it.B
are we ready?D%
H >=
no: tab to the next repetitionF
increase the numberG'
H + 1
Imp: Locate import file
A"set no filtering of visible files:BN
|("TrFile-SetDefaultType"
TrFile-SetDefaultType
|("TrFile-Get FileSpec Dialog"
"Find the import file")
TrFile-Get FileSpec Dialog
Find the import file|D]
|("TrFile-FileSpec To FullPath"
TrFile-FileSpec To FullPath
|("TrFile-CopyFile"
& "|" &
TrFile-CopyFile
<> 0
Export
Cancelh
Replace
An Error occured. See the layout for an explantion of errors.G'
Imp: Locate first image
A"set no filtering of visible files:BN
|("TrFile-SetDefaultType"
TrFile-SetDefaultType
|("TrFile-Get FileSpec Dialog"
"Locate the first image")
TrFile-Get FileSpec Dialog
Locate the first image|D]
|("TrFile-FileSpec To FullPath"
TrFile-FileSpec To FullPath
Imp: Clear fields
----- Multi Export ------
----- Multi Image Import ------
FolderList
O = ""
Cancel
Please select a folder to list first.
FolderList (Select Folder)
|("TrFile-FindFolder"
"root")
TrFile-FindFolder
root|B]
|("TrFile-FileSpec To FullPath"
TrFile-FileSpec To FullPath
A To FolderList (Scripted Version)
----- FolderList ------
To FolderList Demo
O = ""
) = 1
|("TrFile-FileSpec To FullPath"
|("TrFile-FindFolder"
"root") )
"C:"
TrFile-FileSpec To FullPath
TrFile-FindFolder
root||
A Do Search
|("TrFile-ListFolder"
K & "|" &
TrFile-ListFolder
To Search Demo
U= ""
) = 1
|("TrFile-FileSpec To FullPath"
|("TrFile-FindFolder"
"root") )
"C:"
TrFile-FileSpec To FullPath
TrFile-FindFolder
root||
TEST Search Loop
"aa"
"bb"
"ee"
"ff")
=1000
Print one PDF
Q = ""
Cancel
Please select a file name to search for first.C
"Searching...."
Searching....Ej
|("TrFile-Search"
T & "|"&
U & "|" &
TrFile-Search
W > 0
"Nothing Found!")
Nothing Found!2
----- Multi PDFs ------
Do Multi PDFs
|("TrFile-DeleteFile"
TrFile-DeleteFile
C|B'Select just 10 records to start with...C"Now we loop to do the multi exportDH
& "Demo" &
) & ".PDF"
F = "Yes"
|("TrFile-DeleteFile"
TrFile-DeleteFile
Exp: Locate PDF file
|("TrFile-SetDefaultType"
"PDF ")
TrFile-SetDefaultType
PDF |B
|("TrFile-Get FileSpec Dialog"
"Locate the Printed PDF")
TrFile-Get FileSpec Dialog
Locate the Printed PDF|C;
2) <> "$$"
|("TrFile-FileSpec To FullPath"
TrFile-FileSpec To FullPath
Cancel
The next step will delete the just selected PDF file This is needed for the multi printing to work. Do you want to delete it?F*
) =2
|("TrFile-DeleteFile"
TrFile-DeleteFile
|("TrFile-MoveFile"
C & "|" &
TrFile-MoveFile
<> 0
Export
Cancelh
Replace
An Error occured. See the layout for an explantion of errors.J+
) = 1
To Multi PDF Printing
----- Troi Test scripts ------
----- Search ------
To Multi Import v3
A"File Manipulation: Get Folder Spec
Cancel
To get the File Specification of any file, use the function: