Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z
faqs.org - Internet FAQ Archives

[FAQ] FileMaker Pro - database for Macintosh and Windows
Section - 7 Scripting

( Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Airports ]


Top Document: [FAQ] FileMaker Pro - database for Macintosh and Windows
Previous Document: 6 Find
Next Document: 8 Miscellaneous Tips
See reader questions & answers on this topic! - Help others by sharing your knowledge
7.1   ScriptMaker
 
 Check the manuals, chapter 5, "Using ScriptMaker and Buttons". It's
 rather basic, but there's not much more behind.
 Unfortunately, you can't edit scripts manually, you can't copy/paste
 script steps and you can't copy scripts between databases. You may
 duplicate scripts and databases.
   
7.1.1  What's that restore option? - Find & sort within a script
 
 That's one of the options not so obvious. When you create a script, FMP
 will keep the options of your previous commands as options. This is
 valid for: Find, Sort, Page Setup (printing), Import and Export.
 When you create a find script step and use the restore option, the
 criterions of the last used find commands get used.
 You may view these criterions when you perform a refind command. You
 also may print the script definitions.
 You have to ensure that your actual layout displays the fields where
 find criterions will get used!
 If you want to modify the stored information, you will have to perform a
 modified find, edit the script, and after clicking ok you will get a
 dialog box to keep or replace the information. Click the check box to
 replace Find Requests. Now the new information gets saved.
 By and large this is all the same for the other restore options.
 As you might imagine: there is only one valid restore option for each
 type of script command within a script. Nevertheless, you may use
 multiple finds easily:
 Perform first search, create script "Find 1";
 perform other search, create script "Find multiple";
 additional to the find criterions in "Find multiple" you may perform
 additional find requests within by calling the sub script "Find 1".
   
7.1.2  Special options
 
 - When you use Copy[] without options while no field is selected (e.g.
 Goto Field[]), all fields on the current layout get copied to the
 clipboard. The fields are copied in the creation order, seperated by
 tabs.
 There is no known solution to paste in multiple fields in a single step.
 - Using summary fields in scripts:
 "Remember to use the Refresh command with an Enter Browse Mode step if
 you wish to copy the values from Summary fields. However, copying a
 summary field in a script may not work reliably in all cases. If a
 script specifies a Copy step for a summary field that has not already
 calculated, it will copy a null value. This happens because the script
 progresses before the summary field is given time to calculate. Be sure
 you are using FileMaker Pro 2.1v2 or later as this was fixed in this
 version. "
 (from www.claris.com TechInfo)
   
7.1.3  Documenting scripts
 
 Scripts may be printed, including all parameters and options set.
 See Print2Pict
   
7.1.4  Recursive and Conditional scripts
 
 You may call scripts recursively in order to loop, repeat or do while,
 but you should provide a certain break criterion. This has been a most
 requested feature for FMP 2.1, and FMP 3.0 offers both if/else/end if
 and loop/end loop constructs.
 Here are some workarounds for FMP 2.1
 A typical example is:
 Script A:
   Perform Find[restore]
   -- now you are within the first record of the found set
   Perform Script ["B"]
   -- this is the recursive part
   Do...
   -- do some final processing
 Script B:
   Copy [field 1]
   Paste [field 2]
   ...
   Go to Next Record [exit on last]
   Perform Script ["B"]
 This option [exit on last] is a powerful workaround to implement
 conditional scripting. Its concept is:
   if this is the Last/First record
   then exit
   else process
 The simple exit is equivalent to a "do nothing" and is sufficient for
 many tasks. In order to implement real if/then/else scripts you may use
 and manipulate special search criterions (such as a simple mark field)
 or modify the plain
   if A
   then B
   else C
 to something like
 Script C:
   find A
   mark all
   perform Script B
   find marked
   perform C
 Script B:
   exit on last
   perform B
   unmark all
 As you may see, the mechanism is based on a find and work with certain
 sets of records. In order to use this behavior you have
 - to create a proper search criterion
 - to ensure that a find on this set never fails
 - to do the processing itself
 A proper search criterion may be based on any fixed value, calculation
 or user input.
 You must take care that your search command will return a proper set of
 records. If it fails without dialog, the find command will select ALL
 records, and therefore all records will get processed (fatal if you use
 a Delete Found Set command).
 For that reason it is recommended to use dummy entries. A find will be
 performed on the search criterion OR dummy record and will return at
 least the dummy record. See the section on dummy entries for details.
 See the section "no matching record found" for another example.
 I should mention that recursive and conditional scripts can be done
 within AppleScript or FMP 3.0 much better.
   
7.1.5  Dummy entries
 
 Dummy entries may get used to buffer values and to improve the
 performance of recursive, conditional and find scripts. Most of the time
 they are more or less elegant workarounds for missing features or bugs.
 Personally I use two solutions, dummy records or dummy variables. Both
 may be permanent (static) or variable (dynamic). A third exception is
 that I buffer user inputs by selecting the find mode.
 The dynamic record approach is the safest. A script may contain this:
   Enter Browse Mode
   Go to Layout ["any layout with the field to paste a dummy value to"]
   Create New Record
   Go to Field ["the field to paste a dummy value to"]
   Paste Literal ["dummy"]
   Enter Find Mode [use restore, paste literal or by user]
   Create New Request [use paste literal "dummy" or restored "dummy"]
   Perform Find
 Now you will have all found records plus all found dummies.
 A new dummy record will be the last of all (found and unsorted) records.
 You may delete it since it is of no further use, e.g. by Go to Last,
 delete record, then process and step backwards, or step from the first
 to the next, exit on last, and delete the last within an outer script,
 etc.
 The advantage is that after processing there won't be any dummy records
 left, the data of other records is not touched. The disadvantage is that
 it is slower to create and delete new dummy records every time, and that
 a serial counter will continue with an increased value.
 If you keep the dummy record, you should hide it from the user, since it
 may confuse. As soon as this dummy record gets deleted, the performance
 is endangered. For a permanent dummy record I recommend to use the first
 record as dummy and help, but to protect and hide this record from the
 ordinary user as good as possible: Take it as record one, displaying the
 text "No records found", but omit it when other fields were found.
 For other purposes I insert a dummy value to a special field of an
 existing record. Best suited is a number field, named e.g. as "[mark]".
 Number fields get indexed faster than text fields, but may contain text
 as well. Go again in browse mode to a layout that contains the dummy
 field,...
   Go to Field["[mark]", select all]
   Paste Literal ["999 dummy"]         -- BTW this gets indexed as 999
   Enter Find Mode  [use restore, paste literal or by user]
   Create New Request [use paste literal "999" or restored dummy]
   Perform Find
 You may keep the dummy value, but it is better to delete it, e.g. by a
   Perform Find[restored ">0"]
   Go to Field "[mark]", select all]
   Paste Literal [""]
   Replace
 The drawback is that you may need an additional field, and that the
 actual record where you paste the dummy value will be processed either
 every time or never, dependent on your script, but not dependent on its
 other field contents. I prefer it e.g. when I know that the actual
 record must be within the set of records, or when the processing is only
 time consuming, but does no harm.
   
7.1.6  Go to last record
 
 Go To Record 2147483647 will take you to the last possible record since
 this is the maximum number of records possible in an FM Pro file.
 (From Michael Singer's book)
 Any other number higher than the real maximum number of records will do
 so as well. Personally, I use serial number 99999999.
 When you open the database, you will get not the record you edited last,
 but the first of the records found. Creating a script "go to last" that
 is autoexecuted while opening the database will put you to the last of
 this records. Including a "select all" step may put you to the last new
 record, while otherwise the find and sort order is still maintained.
   
7.1.7  Schedule Scripts
 
 How can I run a script at a specified time?
 This has become one of the most frequently asked questions on the
 MacScripting list. There are several commercial, shareware, and freeware
 utilities that will allow you to do this. Your commercial option is
 Scheduler, which comes with Script Debugger. You can find a demo version
 of it on gaea.
 Your freeware options are Cron 1.0.0 and Cron1.0d16. Cron 1.0.0 is a
 cdev and an application that can launch application and document
 aliases. You rename the aliases to reflect the time that you want them
 to launch. Cron 1.0d16 was written by Chris Johnson of GateKeeper fame.
 You can always find the latest version of Chris' Cron at
 http://gargravarr.cc.utexas.edu/cron/cron.html.
 Your shareware options are Chronograph and CronTab. Chronograph has both
 a 68k and PPC version of the daemon. It also follows the UNIX cron
 format. CronTab is an older collection of AppleScript scripts and
 applets.
 You can also find these cron programs and scripts on gaea as
 Chronograph1.1UR.sea, Cron1.0.0.sit, Cron1.0d16Distribution.sit, and
 CronTab
 Ziff-Davis Publishing also has a soluton that is available in the
 ZiffNet forum on CompuServe. It is called T-Minus Ten and is an
 application and an extension. If you have a CompuServe account, you can
 get the file. Due to ZD's copyright restrictions, the file cannot be
 uploaded to any other service.
 (from the AppleScript FAQs)
   
7.2   AppleEvents
 
 Section under construction - please provide information
   
7.2.1  FMP documentation
 
 For information on scripting FMP check the template "FileMaker and Apple
 Events"
 (formerly called "FileMaker Events and Objects")
 Included with FileMaker Pro 2.x in the Apple Events Example folder on
 the Utilities disk. This FileMaker reference database provides
 documentation of every object and event accessible by AppleScript and
 Apple Event-savvy programs. Topics include syntax examples, the
 FileMaker containment hierarchy, keyforms, and event parameters and
 id's. The new version of this database adds new information, examples
 for AppleScript and Frontier, and a matrix of events and objects. The
 update can be found with FileMaker Pro 2.1v2 and later. Also in the
 Apple Events Example folder, see examples of scripts that take data from
 a FileMaker database and create charts in Excel or Resolve.
   
7.2.2  Classes
 
 Those classes are supported by FMP:
 capp: class Application
 cwin: class Window
 cdoc: class Document
 cDB : class Database
 ctbl: class Layout
 ccol: class Field
 crow: class Record
 ccel: class Cell
 cSCP: class Script
 cmen: class Menu Item
 cmnu: class Menu
 Most classes provide read-only properties. Check FMP itself for details,
 using e.g. the open dictionary command of the ScriptEditor.
   
7.2.3  References
 
 Elements of objects may get referenced in multiple ways. Here are some
 (all?) types and some examples
 name: its name
   tell application "FMP"
 absolute: its numeric index
   show window 1
 relative: before/after another element
   copy fields of records before (current record of database 1)
 range: a range of elements
   (syntax?)
 ID: the ID of an object. In general an integer property, but on cells it
 is a list {<record ID>, <cell ID>}
   exists record 10
 test: satisfying a test
   repeat with every record whose cell "searchfield" = FindCriterion
 "show every record whose cell <cellName> is <cellData>" no longer
 accepts FMPro special characters within FMP3. To use those you have to
 use "requests". Unfortunately, use of requests adds several apple events
 to a search.
   
7.2.3.1 References table
 
 This is the hierarchy of FMP objects:
   capp - cwin - cdoc - cDB  - ctbl - ccol - ccel
                                    - crow - ccel
                                    - ccel
                             - cSCP
               - cDB  ...
               - cSCP
        - cdoc - cwin ...
               - cDB  ...
               - cSCP
        - cmnu - cmnu ...
               - cmen
   ref. by         cwin cdoc  cDB ctbl ccol crow ccel cSCP cmen cmnu
   name           |  x |  x |  x |  x |  x |  x |  x |  x |  x |  x |
   absolute       |  x |  x |  x |  x |  x |  x |  x |  x |  x |  x |
   relative       |    |    |    |  x |  x |  x |  x |  x |    |    |
   range          |    |    |    |  x |  x |  x |  x |  x |    |    |
   ID             |    |    |    |  x |  x |  x |  x |  x |    |    |
   test           |    |    |    |  x |  x |  x |  x |  x |    |    |
   
7.2.4  List of events
 
 open / print / quit / run Copy / Cut / Paste Begin Transaction / End
 Transaction / Event Info / Save -- Usage? Class info / Close / Count /
 Create / Data Size / Delete / Do Menu / Do Script / Duplicate / Exists /
 Get Data / Open / Redo / Set Data / Show / Sort / Undo
 ??? What's the difference between open / print / quit (required suite)
 and Open / Print / Quit (FMP Core, Table, Database suite)
 ??? What's the difference between Set and Set Data?
 ??? What's the difference between Get, Get Data and no event at all?
 - most important events:
 * Set
   set cell "Name" of layout 0 to "Martin"
 * Get <reference>
   set MyName to [get] cell "Name" of layout 0
   
7.2.5  Sending events
 
 In the FileMaker you just create a new script in ScriptMaker, and
 - add command "Send AppleEvent [...]"
 - push button "Specify..."
 - push button "Specify Application" and select your applet.
 - choose from popup menu "Other..."
 - input: Event Class: "PIPS" and Event ID: "pip2"
 If you don't use any parameters, that's all. If you do, you must either
 1) put value of your parameter in the AppleEvent definition dialog
 (select "Script text" radio button), or
 2) put it in one of FileMaker Fields (select "Field value" radio button
 and show the field you want to use).
 The AppleScript looks like this:
 on «event PIPSpip2» (howmany)
   beep howmany
 end «event PIPSpip2»
 (by Ilmo Kotivuori <ilmo.kotivuori@ILMO.PP.FI>)
 The simple events sent from FMP can only send a single parameter (in the
 keyDirectObject parameter, '----'). You need to build up more complex
 data structures for most events from and to FMP, so you'll have to use
 e.g. an AppleScript as an intermediary.
 (by Wayne Walrath <wkw@acmetech.com>)
   
7.3   AppleScript
 
 Section under construction - please provide information
   
7.3.1  System requirements
 
 System 7.1 or better
 AppleScript 1.0 or better (actual 1.1.1?)
 Editor:
 ScriptEditor (System 7.5) or
 ScriptDebugger (URL:?) or
 ScriptWizard or
 Scripter
   
7.3.2  General documentation
 
 ??? please check and provide information
 FAQs:
 http://www.sysnet.com/~pfterry/applescript.faq.html
   
7.3.2.1 Books
 
 See http://www.claris.com/techinfo/CAMON9220228814.html for a
 comprehensive list.
 Derrick Schneider: "The Tao of AppleScript (second edition)", Hayden
 Books, Carmel, 1994.
 Price $24.95 (U.S.); $31.95
 Danny Goodman: "Danny Goodman's AppleScript Handbook", Random House
 Electronic Publishing, 1995.
 Price $39.00 (U.S.); $55.00 (Canada.)
 Tom Trinko: "Applied Mac Scripting", M&T Books, 1995.
 Over 800 pages, Price $34.95 (U.S.); $47.00 (Canada.)
 Dave Mark: "Ultimate Mac Programming: Methods of the Macintosh Masters",
 IDG Books Worldwide, 1995.
 Price $39.95 (U.S.); $54.95 (Canada.)
 "AppleScript Language Guide: English Dialect", Addison-Wesley, 1994.
 Price $29.95 (U.S.). ISBN 0-201-40735-3
 same documentation as found in the AppleScript Developer's Kit from
 Apple Computer
 "AppleScript Finder Guide", Addison-Wesley, ISBN 0-201-40910-0
 Steve Michel: "Scripting the Scriptable Finder", Heizer Software, 1995.
 Price $49.00 (U.S.)
 Heizer Software at (800) 888-7667 or (510) 943-7667.
 Claris Corp.: "TechInfo Journal", Claris Support Service.
 quarterly; call Claris Customer Assistance at (800) 325-2747.
 The Cobb Group: "Inside FileMaker Pro"
 Monthly, Price $59.00/yr or $7.00 each (U.S.). ISSN 1068-6908.
 "INSIDE MACINTOSH: Interapplication Communication", Addison Wesley
 Publishing Company, Menlo Park, California.
 Price: $36.95.
 "Inside Macintosh - AppleScript", ?
   
7.3.2.2 Online documentation
 
 Web & FTP:
 Scripts, scripting additions, demos, and other scripting-related files
 can be found at the following ftp site:
 <ftp://gaea.kgs.ukans.edu/>
 <ftp://gaea.scriptweb.com>
 <http://www.scriptweb.com/scriptweb>
 <ftp://gaea.scriptweb.com/pub>
 <ftp://gaea.scriptweb.com/pub/applescript/>
 <http://rever.nmsu.edu/~elharo/faq/Macintosh.html>
 <http://www.ultranet.com/~mfenner/applescript.html>
 <http://mmm.dartmouth.edu/pages/macscripting/macscripting-home.html>
 Internet:
 The MACSCRPT mailing list is a highly active forum devoted to scripting
 on the Macintosh and focuses on AppleScript and UserLand Frontier. To
 subscribe to the Macintosh Scripting mailing list send a message using
 one of the following methods:
 - To subscribe to the MACSCRPT list,
 Send message to: LISTSERV@dartmouth.edu
 Subject: subscribe
 Message: subscribe macscrpt
 APPLESCRIPT Mailing Lists:
 Purpose: For discussion of AppleScript.
   applescript-implementors@abs.apple.com
    is for users creating AppleScript savvy applications.
   applescript-users@abs.apple.com
    is for users of AppleScript.
   applescript-language@abs.apple.com
    is a private list for creators of AppleScript language pieces.
   AppleScript-request@abs.apple.com
    is for more information
 AppleLink
 "AppleScript Developer's Forum" in Developer Support: AppleScript Talk
 "FileMaker Support Forum" in Third Parties:Third Parties
 A-G:Claris:Claris InfoCenter:Technical Support - (Read):Technical
 Support - FileMaker
 "UserLand Forum" in Third Parties: Third Parties P-Z: UserLand
 Discussions
 America Online
 Keyword CLARIS, Technical Support:FileMaker Pro:FileMaker Message
 Boards:Scripting
 Keyword MOS, Message Board:General Discussion:AppleScript
 Keyword USERLAND
 CompuServe
 Go MACCLARIS, Browse Messages, FileMaker [2]
 Go MACDEV, Message Sections:Scripting Month [10]
 Go USERLAND
 eWorld
 Message Sections -Computer Center:Apple Customer Assistance Center:Apple
 Products &
 Technologies:The World of Apple Software:System Software Discussion:
 AppleScript 1.1 folder and
 Apple events folder.
   
7.3.4  Tips
 
 - Fields are like columns, Records like rows of a table. Single elements
 are Cells.
 - All fields are available via layout 0
 - The last record may be used by ID -1, e.g.
 tell record -1 -- (same as 'tell last record')
 - Within FMP3 "Document" refers to the found set, as sorted. "Database"
 refers to the entire database, in record creation order (ignoring the
 found set). This was also supposed to be true in FMPro 2.1v3, but was
 not.
 (from owen@astro.washington.edu (Russell E. Owen))
 -"create new record" (and create new request) has two bugs for FMP3:
 1) it sometimes creates in the wrong database, specifically:
       tell document <databaseName
           create new record
       end tell
 ignores the "tell document" and instead creates the record in the
 top-most database, but:
       create new record at database <databaseName>
 works just fine. Be careful!
 2) One can supply a list of data with the create command (in field
 creation order -- ick), but it uses the current layout or layout 1 (I'm
 not sure which) to set the data. There doesn't seem to be any way to
 force it to use layout 0 (an invisible layout that contains all fields).
 The documented method:
     create new record at layout 0 with data <list-of-data>
 does NOT work. A workaround is:
     set recID to create new record at database <databaseName>
     set record ID recID of database <databaseName> to <list-of-data>
 (see ROFMUtil for a subroutine to create <list-of-data>).
 (from owen@astro.washington.edu (Russell E. Owen))
   
7.3.5  Examples
 
 Useful examples:
 * data of first cell
   cell 1 of database 1
 * data of first cell of selected records
   cell 1 of document 1
 * data of first cell of current record
   set CurRec to (Current Record of Database 1)
   cell 1 of CurRec
     -- should be equivalent to
   cell 1 of (get Current Record of Database 1)
 *  data of all cells:
   cell 1 of every record
     -- is equivalent to
   field 1
   
7.3.5.1 Load all image files
 
 -- Load all the Image files from a (prompted for) folder into a
 FileMaker
 database.
 -- "PictureLoads" and this file must be in the same location.   (V1.1)
 -- find the image files
 set ImageTypes to {"PICT", "JPEG", "BMPp", "TIFF"}
 set ImagesLocation to (choose file with prompt .
         "One of the Image files to load" of type ImageTypes) as string
 set x to (length of ImagesLocation) - .
         (length of (name of (info for file ImagesLocation)))
 set ImagesFolder to (characters 1 thru x of ImagesLocation) as string
 set ImagesList to list folder ImagesFolder
 -- where the hell are we? (only works in compiled "application" version)
 set DefaultLocation to (path to current application) as string
 set x to (length of DefaultLocation) - .
         (length of (name of (info for file DefaultLocation)))
 set DefaultFolder to (characters 1 thru x of DefaultLocation) as string
 -- fire up FileMaker and JPEGView applications
 set chk to {}
 set PictureName to ""
 tell application "Finder"
         set FileMaker to application file id "FMPR" as string
         set JPEGview to application file id "JVWR" as string
 end tell
 tell application FileMaker
         run
         open file (DefaultFolder & "PictureLoads")
 end tell
 tell application JPEGview
         run
 end tell
 -- walk the list, open file in JPEGview, copy to new FileMaker record
 repeat with ImageName in ImagesList
         --(debug)set PictureName to ImageName
         set ImageLocation to ImagesFolder & ImageName
         set ImageInfo to (info for file ImageLocation)
         set candidate to false
         if not (folder of ImageInfo or alias of ImageInfo) then
                 set ImageType to file type of ImageInfo
                 if ImageTypes contains ImageType then
                         set candidate to true
                         set chk to chk & ImageName & ImageType
                 end if
         end if
         if candidate then
                 tell application "JPEGView"
                         activate
                         open {alias ImageLocation}
                         copy
                         close windows saving no
                 end tell
                 tell application "FileMaker Pro"
                         activate
                         Create New Record
                         --(debug)set PictureName to PictureName & return
 & (ImageName as string)
                         Do Script "PasteImage" -- just does a Paste
 [Select, "PictureField"]
                         copy (ImageName as string) to (Cell "FileName"
 of last Record)
                 end tell
         end if
 end repeat
 -- a little clean up
 tell application "JPEGView"
         quit
 end tell
 -- de nada
 (From Sam Malenfant)
   
7.3.5.2 Idle handler
 
 "When a stay-open applet has an idle handler but doesn't return a sleep
 time, the default is to call it every thirty seconds. Strangely, when
 there is no 'on idle' handler the Applet sucks time all over the place.
 The solution: always include an 'on idle' handler in your stay-open
 Applets but return a very large sleep time."
 (by "Wayne K. Walrath" <wkw@FUTURIS.NET>)
 on idle
   return 30000
 end idle
   
7.3.5.3 Object not found / error -1728
 
 Error -1728 is object not found:
 on error -1728
   -- "object not found", which could mean no records match
   -- or the database wasn't found, or a cell wasn't found or...
   -- it's a shame the error message isn't more specific
   if (not exists database <databaseName> then
     error "Database " & <databaseName> & " does not exist"
     else if (not exists cell <readCellName> then
       error "Cell " & <readCellName> & " does not exist"
     else
       -- either one of the search cells does not exist (a hassle to
 test)
       -- or no records match; assume the latter
       set recData to {} end if
 end error
 (example by Russell E Owen <owen@ASTRO.WASHINGTON.EDU>)
   
7.3.5.4 Multiple finds
 
 AppleScript is very powerful to use for nested finds.
 Here's one example on how to find on multiple fields that may be
 configured by the user easily. A similar ScriptMaker approach would
 require any possible set of find combinations, including multiple
 copy/paste of find criterions.
 Within FMP you should create a field with a predefined value list of
 field names, e.g.:
 [search_fields] (text):
 section
 subject
 body
 comments
 Format this field as a checkbox field. Autoenter of values is possible.
 Enter the search criterion to a find field and call the AppleScript.
 Within the AppleScript use the find criterion on all names of the search
 fields by something like
   repeat with TheName in TheSearchFields
     set cell "[mark]"
       of (every record whose cell TheName = TheSearchCriterion)
       to 1
 This will search for an exact match, but others are possible as well as
 multiple and nested AND/OR solutions.
 Unfortunately there seems to be no command for a found set. Thus all
 records have to be marked, then a find on [mark]=1 within FMP has to be
 performed, then the mark field should get deleted again.
   
7.3.6  Call AppleScript
 
 As described before you may send various AppleEvents from within FMP.
 When you compiled the script as application, you may pass events to it:
 on «event xxxxyyyy»
   -- do something
 end
 Another solution is to pass complete scripts to an AppleScript editor.
 You may send e.g. the "run script" event to the ScriptEditor:
   send AppleEvent ["syso", "dsct", "ScriptEditor"]
 and pass the script as text. Example:
 within the ScriptMaker of FMP select "send AppleEvent". Specify the
 application "ScriptEditor". Specify "Send the [Other] event" with event
 class "syso", event ID "dsct". Specify the script text as:
 tell application "Eudora"
 make new message at end of mailbox out
 set field "Subject:" to "text"
 set field "To:" to "your nickname"
 queue
 end tell
 "Effectively you call the Run Script osax (which should be present in
 your Scripting Additions inside your Extensions folder). The trick is to
 "tell" a non scriptable application (such as the Script Editor or any
 other utility with no "aete" resource) to "run script etc..."
 FMP can send simple events with only 1 direct param.
 (inspired by raif@fl.net.au (Raif S. Naffah))
   
7.4   Aretha / Frontier
 
 Yet another scripting system for AppleEvents.
 It's free, it's faster than AppleScript, it's powerful.
 <http://www.hotwired.com/staff/userland/aretha/>
 please provide further information
   
7.5   Other tools
 
 check for:
 - ControlTower
 - HyperCard
 - MacPerl
 - UserTalk
 Ross Brown has written an extension called Menu Events. It allows you to
 control the menus in an application that is System 7 savvy though
 unscriptable. It is archived at
 ftp://gaea.scriptweb.com/applescript/addons/
 along with a companion program
 ftp://gaea.scriptweb.com/applescript/addons/
 James Davis (jedavis@cs.stanford.edu) has written an AutoType osax that
 lets you simulate keyboard activity from a script. AutoType sends
 keystrokes to the front application. It is archived at
 ftp://gaea.scriptweb.com/applescript/osaxen/AutoType1.0.sit
 (from http://www.sysnet.com/~pfterry/applescript.faq.html)
 Probably the slickest solution is PreFab's Player. PreFab Software's
 Player extension lets you select menu items and click buttons and
 checkboxes in applications. Player has a smaller memory footprint than
 QuicKeys, and it is easier to incorporate Player into your scripts than
 QuicKeys. Player is available for both Frontier and AppleScript. Prefab
 Software can be reached at 617/628-9555, voicemail; 617/628-9043, fax;
 617/628-9025, inquires and sales; CompuServe: 70214,424; and Internet:
 player@prefab.com, http://www.tiac.net/prefab/
 (from ftp://gaea.scriptweb.com/applescript/PRs/)
   
7.5.1  Quickeys
 
 Quickeys 3.0
 CE Software, Inc.
 Quickeys 3.0, a macro program for the Macintosh, now allows you to write
 AppleScript commands
 directly in your macros. Quickeys also provides scheduling facilities
 and extensions that allow you to
 mount volumes and choose printers. Suggested retail price as of Sept. 1,
 1994 is $139.00 (U.S.).
 Contact CE Software at (515) 221-1801.
   
7.5.2  KeyQuencer
 
 "We often meet problems that can't be solved within FileMaker. Selecting
 printers, sending faxes with the click of a button, using alerts and
 dialogs, dialing phone numbers etc. We need to go beyond FileMaker.
 Features:
 - small memory footprint (full installation takes up a total of 124k on
 my 68k Mac)
 - modular; remove unused commands to save memory or add capabilities
 with third party extensions (developer's toolkit included)
 - powerful, clean and reliable (has never crashed my Mac and I haven't
 seen an application that doesn't like KeyQuencer)
 - networkable; control a mac remotely over AppleTalk
 - fast; no process overhead as in AppleScript solutions
 - best of all: Apple Events savvy, easy to execute macros from a
 FileMaker script using Send AppleEvent
 One disadvantage is that KeyQuencer isn't recordable, but I still think
 it's easy to use."
 (from Johan Solve <macboden@ALGONET.SE>)
 <ftp://umich-mac/system.extensions/cdev/keyquencer1.21.sit.hqx>
 <ftp:/info-mac/gui/key-quencer-121.hqx>
 <ftp:key-quencher-121.sit>
 Shareware 10 $
 It was developped by Alessandro Levi Montalcini - his next release is
 supposed to be commercial.
 It is also useful to import plenty of pictures. It's easy to use in
 order to script special tasks by automating manual tasks.
   
7.5.3  Tools for Windows
 
 While all other tools in general are suited for Macintosh only (as long
 as not stated otherwise), there are some matching tools for Windows:
 Q: Is there under Windows a applescript-similar (comparable) programm ?
 A: Actually there a quite a few of them.  None ship WITH Windows
 however.  There is a REXX version for Windows, Visual Basic for
 Applications is for controlling supported applications, OLE can do some
 things, but it is mostly document based.  WinBatch is an excellent
 AppleScript-like thing.  It can do ANYTHING you can do in Windows, as
 well as some system-level things.
 (From: Kurt Knippel <MondoMail@AOL.COM>)

User Contributions:

Comment about this article, ask questions, or add new information about this topic:

CAPTCHA




Top Document: [FAQ] FileMaker Pro - database for Macintosh and Windows
Previous Document: 6 Find
Next Document: 8 Miscellaneous Tips

Single Page

[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:
traut@th-darmstadt.de (Martin Trautmann)





Last Update March 27 2014 @ 02:11 PM