Can you write scripts in a text editor?
Is there a way to write/edit scrips with the keyboard instead of having to use the mouse to select the command, then specify the parameters, then specify the calculations etc...?
No, I do not think so. Scripts are written in XML and not easily accessible from vanilla FMP.
http://www.fmpromigrator.com/products/fmpro_script_diff/fmpro_script_diff_overview.htmlAbout FmPro Script DiffFmPro Script Diff compares, edits, searches and stores FileMaker ScriptMaker scripts - outside the FileMaker database. Changed scripts are compared on a line-by-line basis and displayed with color coded tags to the left of each modified line. Interline changes are also highlighted to indicate Changed, Added or Deleted text. Each script’s XML source can be manually edited or updated via the Search & Replace feature, and pasted back into FileMaker.
http://www.360works.com/scriptmaster/ScriptMaster 4 is a free, general-purpose plugin. It includes file manipulation, URL and network utilities, shell scripting, encryption, and much more.
Google "import scripts site:filemaker.com"https://www.google.com/search?q=import+scripts+site%3Afilemaker.com
Home > Designing and creating databases > Creating scripts to automate tasks > Creating and editing scripts > Importing scripts from other FileMaker files
LINK #2 SubLink @1http://help.filemaker.com/app/answers/detail/a_id/6545/kw/importing%20scripts
Difference Between A Script Step Vs. ScriptMakerWhat is the difference between a script step and ScriptMaker?Updated: May 24, 2011
8690 Often there is confusion on the terminology of a Script Step and ScriptMaker. The following defines the difference between these two and the architecture of scripts. To clarify some of the confusion between the two, the following is a breakdown of actual script steps and the ScriptMaker feature. Script steps are the set of commands, which are in the ScriptMaker feature, to be added to a script, in order to automate tasks or operations inside of FileMaker Pro. Many FileMaker Pro script steps can be made available to web users when you publish your database using Instant Web Publishing.
There are 12 categories of script steps:
The ScriptMaker feature in FileMaker Pro is a building tool for creating scripts by selecting from a list of FileMaker Pro script steps. You are then able to specify options (if necessary), and arrange the steps in the correct order to perform the task. Some tools within ScriptMaker include:
An example of a printing script that shows a custom dialog with printing options: This example asks the user if they would like to print giving 3 options of; “Cancel”, “PDF”, or “All Records.” The script then performs an If Statement which checks to see which option were chosen, which then exits the script after the selection is completed. For more information on script steps, please refer to the FileMaker Pro 9 Scripts Reference Guide.
LINK #3 Sublink #5http://help.filemaker.com/app/answers/detail/a_id/6151/kw/importing%20scripts
What do I need to know about scripts in FileMaker Pro?Updated: Sep 20, 2011Planning a Script The more time you spend planning your script, the more likely that it will accomplish what you want. As you plan, ask yourself these questions:
It will import the script.Open the imported script, Copy all the script steps, Paste those scripts all the steps if the script is already existing then you need to rename that script, because after import of the same script after some modification, application will refer to the newly imported script.
APPLICABLE TOFileMaker Pro 7, FileMaker Pro 6, FileMaker Pro 6 Unlimited, FileMaker Pro 5, FileMaker Pro 5 Unlimited, FileMaker Pro 3.x, FileMaker Pro 2.x, FileMaker Pro
Note: If you are at all unsure of changes you will be making to your script, make a duplicate of the script and test out the changes there. Never work on your only copy of a script!
Using the Pause/Resume script stepOne of the most useful approaches to troubleshooting scripts is to use the Pause/Resume step to check conditions during the execution of the script. You can check the value being returned by a step in a script by creating a test field, and adding a step to paste into that field, then pausing the script. When you are done, you can delete the field's definition and delete those two steps from your script.
Example:[Your previous script steps]Paste ["Value Check Field"]Pause/Resume Script 
You can put this series into your script many times, and check the progress of the script at each important point. This will indicate where you have the wrong value being copied or returned or will confirm that you have the correct value.
Divide the script into distinct portionsIt can very difficult to look at a long script and be able to tell where the problems are. Dividing a long script into several parts may make it possible to tell where a problem is happening and certainly makes it easier to create complicated scripts. This also makes each part of the script available to use in other chains of scripts.
Hint: If you already have a script and wish to divide it, you can duplicate the script and delete the unwanted parts rather than re-entering each part.
Example: You have a long script that does a find, exports records, does another find, sorts, then prints. It changes layouts to perform each of these actions.
Instead of one long script you might organize it like this:Perform Script["Find all the Hints"]Perform Script["Export the Hints"]Perform Script["Find the Tips"]Perform Script["Sort by Article Number"]Perform Script["Print"]
Creating a Script Plan/Flow ChartIf your script is complicated, or if you have several scripts calling each other, you might want to draw out a flow chart or list. This will help you understand and visualize the flow of information.
Here is a simple flow list:
- Copy the customer ID- If the invoice has been paid, exit the script- If customer ID is over 1000 and the customer type is retail, go to the Retail file and paste in the ID to create a new record- If the customer ID is less than 1000, go to the Charitable Foundations file and paste in the ID, and run the 'New ID script'- Return to the original database and go back to the original layout
You can see that this list is in plain language. There may be additional steps to flesh out and this leaves out many details, but you at least have a readable road map. Most people find this easier to translate to a script than trying to work within ScriptMaker to set up complex systems. You can also use a drawing program to draw a flow chart.
This is extremely valuable in scripts that contain Loops. Using this technique and the Pause/Resume Script step as outlined above can help track down problems that are extremely difficult to visualize from a script.
Common problemsHere's a list of things to check when your script is not doing what you expect:
- Is it going to the right layout?- Are you trying to copy to or paste from a field that is not on the current layout?- Is the field you are looking at in Browse mode really the field you think it is?- Have you checked the result of your conditional ('If' script step)?- Are you trying to do something in your current file that is actually happening in an external script?- Are your conditionals and loops in the right place?- Is the script doing the Find you expect it to?- Do you have a Restore on a Find or Perform Find that shouldn't be there?- Is your script doing 2 Finds, effectively canceling out the First find?- Do you have a Find that finds no records?- Is the script doing the Sort you expect it to?- Are your fields sorting in the correct order (ascending or descending)?- Does the user's password allow them to do what the script does?- If the script is dependent on a calculation, is the calculation returning the correct value and type?- Is there a step in the script that is dependent on platform?- Do you need to go to Preview to see the results of the script?- Are you freezing the window and not refreshing it (it will refresh at the end of the script automatically)?- Are you checking for the right message results?
You can copy and paste the calculations that might be used for set variable, calculated field, etc. These could be created in a text editor.
You can copy and paste scripts and steps within scripts to another script.
People LOVE FileMaker for its point and click and eliminating most of the hassle of typing plain text to create commands and scripts. That's why I changed to FileMaker 30 years ago after becoming totally frustrated by DOS command line and dBase and Visicalc functions that errored out but wouldn't tell me why.
Perhaps you could use SQL instead of Filemaker steps?
You can use the Snipped database coming with MBS FileMaker Plugin.
The plugin not just offers a copy script button to get a script for pasting here in the forum (see MBS Blog - Copy Script Button), it also has a lot of Clipboard functions.
So if you copy some script steps in FileMaker, you can use Clipboard.GetFileMakerData function in a solution to get the XML, edit it and put it back on the clipboard with Clipboard.SetFileMakerData. Just like the FileMaker Snippet Storage database included in plugin examples.
The same can be done with ClipManager from myFMbutler. So theoretically you could write it all in a text editor. And for the longest time I have wished that we could but the script editor in 15 and even more so in 16 has become so close to what I expect from a good code editor that I don't feel that need so pressingly anymore.
Replaces / refactoring / auto-complete of variable names are still issues that I wish to see made better in FM's script editor.
The short answer is no you can not use a text editor to write scripts for FMP without some kind of third party utility.
Might be a nice feature request.
I think you should look for the right one apply. I use somthing like this.
Retrieving data ...