Learning AppleScript with Helix

AppleScripts for Helix

The scripts on this page are available free of charge to all Helix users. More scripts are available exclusively to subscribers of the Learning AppleScript with Helix self-paced tutorial.

Scripts are grouped based on which icon type they (primarily) work with.

Field
  • Rebuild Keyword Indexes: This script rebuilds just the keyword indexes in a collection. This is faster than breaking all indexes via Helix Utility when changing the HKWT resource. Updated to handle large indexes without a timeout, and to add better logging. (Hat tip: Lenny Eiger) (v1.1: Jan 7, 2014)
  • Expose Field Datakeys: This script exposes the internal ‘datakey’ property of selected fields, adding it to the comments for that field. If one or more fields are selected, just the selected fields are processed; if no fields are selected, every field in the open/selected relation is processed. This script is useful when troubleshooting HSCM resource issues. (v1.0: Oct 31, 2016)
Abacus
  • Abacus Expression Language Exporter: This script creates a text file containing every abacus (including form query and power query statements) in its Abacus Expression Language (AEL) format. Examining how existing abaci appear in AEL will help you begin to see how you can create a complete abacus via this text-based language. (v1.0: Dec 10, 2011)
  • Examine Tile Constant: This script displays ‘byte by byte’ details of a constant (text typed into a tile socket). (v1.0: Mar 21, 2017)
  • Make A Constant: This script shows how to use the Abacus Expression Language (AEL) to create any abacus constant. It includes some user interaction code. (v1.0: Jan 16, 2012)
  • Make True Constant: This script shows how simple it is to use the Abacus Expression Language (AEL) to create an abacus constant for ‘true’ in the front relation window. (v1.0: Jan 16, 2012)
  • Re-Optimize All Abaci: This script addresses a bug that exists in Helix RADE 6.2b9 (5773) thru 6.2b16 (5850). See the Preliminary Release 17 Release Notes for more details. See comments in script for change history. (v1.2: Nov 16, 2012)
Collection/Relation
  • Make Complete I/O Sequence: This script creates a ‘raw import/export’ view in each relation, sets them to import/export to the folder of your choosing, and adds them to a pair of sequences (one for importing, one for exporting). The sequences should then be able to export all data (except Pictures) from a collection and import it into an identical empty collection. (Assuming the data passes all validations.) (v1.0: Jul 16, 2015)
  • Cascade Icons: Helix RADE 6.2 has improved built-in commands to clean up and arrange icons, but these commands are limited in the icon arrangements they produce. This script gives you expanded control over the icon arrangement: four editable properties let you easily sort icons by kind, with control over the horizontal and vertical spacing, and more. (v1.0: Nov 10, 2012)
  • Count Icons: This script counts each icon type in a collection. A simple dialog reports the results. (v1.0: Feb 24, 2014)
  • Find By Name: This script finds all icons whose name starts with or contains a specified string. (v1.2: Jan 17, 2017)
  • Find Modded Icons: This locates icons in relations whose comments contains a specified string. If you add a consistent comment as you modify icons, this will select them all quickly, making the creation of clippings much easier. (v1.0: Aug 13, 2014)
  • Make Nested Colors: This script redefines entries 100–108 in the Helix color table to match the colors macOS uses when framed group boxes are nested. The script also demonstrates how to make a rectangle and set it to the matching color. (v1.0: Nov 9, 2012)
  • Remove Linefeeds In Icon Names: A bug in Helix 5.0 and earlier could result in linefeed (return characters) being added to icon names. This script examines the whole collection, removing those characters wherever found. (v1.0: Jan 10, 2015)
  • Remove User Name Security (from Sequences and Users): The ”User Name Security” dialog is obsolete, but may be available in the sequences and user menus of existing collections. (A future Helix update will remove it automatically — This setting is now controlled via a property in the Inspector or through AppleScript.) This script removes instances of the command from all sequence and user icons in the open collection, and writes a report detailing the findings as a tab delimited text file. 2.0 adds user icon checking. (v2.0: May 5, 2014)
  • Reset Buttons to Default Style: This script removes Classic font style and color information from every command rectangle (button) in a collection. (v1.0: Mar 22, 2016)
  • Reveal In Finder: A simple script that opens a Finder window containing the currently open collection. Demonstrates how to access the collection file. (v1.0: Dec 13, 2011)
  • Select All Unused: This script selects the unused icons in the active collection or relation window. By default, it excludes indexes from the selection; there is an editable property to change if you want indexes included. (v1.0: Feb 26, 2014)
  • Select Icons Modified Since: This script selects the icons modified after a specified date, using the modification date property of Helix 7.0. (v1.0: May 10, 2016)
  • Stack Relations: This script arranges all of the relations in a collection in a tight stack, switches them to icon mode, resizes them to show all of the icons (if possible), and sets the width of the window to an appropriate size. Uses the new display mode and columns properties of Helix 7.0. (v1.0: Dec 22, 2016)
  • Unlock All Icons: This script turns off the locked property for every icon in a collection. This important when applying structure, as locked icons can not be updated via apply structure. (v1.0: Oct 16, 2015)
Index
  • Rebuild All Indexes: This script rebuilds every index in a collection, one by one. This is useful if you encounter an old Helix bug that results in bad indexes when they are rebuilt en masse. (v1.0: Dec 19, 2012)
  • Rebuild Select Indexes: This script rebuilds only indexes related to the currently selected (or open) icon. (v1.0: Dec 19, 2012)
  • Rebuild Keyword Indexes: See the ‘Field’ section above for a description.
Post
  • Detail Post Setups: This script writes a report that details every post setup in a collection. (v1.0: Aug 10, 2012)
  • Print Posting Finder: Technote R6112 details potential logic issues when using Print Posting. This script writes a report that details every view in a collection that uses Print Posting. (v1.0: Jan 29, 2014)
Query
  • Convert Form Query to Power Query: This script converts form queries to power queries, by transferring data rectangles from the form query template into the “searchable items” list of the power query. The script also searches the relation for abaci that are valid “reference items” and adds them to the power query. Lastly, it reports the result of the conversion, and whether there were any non-editable query items on the form query. Currently Helix can not transfer an existing ‘completed search statement’ from a form query to a power query, so it is written into the comments of the power query, as an aid in recreating the existing search statement. (v1.0: Feb 8, 2017)
Sequence
  • Add Draw Screen (to Sequences): This script inserts a draw screen command after every step of the selected sequences. This may help alleviate some Client crashes related to sequences that “get ahead of themselves.” A list of sequences is presented so the user can choose which ones to modify. (v1.0: Mar 14, 2012)
  • Remove Draw Screen (from Sequences): Sick of the Draw Screen commands added via the “Add Draw Screen” script? This script removes the draw screen commands from the selected sequences. A list of sequences is presented so the user can choose which ones to modify. (v1.0: Mar 14, 2012)
  • Find Printing Sequences: This script examines every sequence in a collection and reports those that contain any of the print commands (page setup, print form, find and print all) along with the ‘show dialogs’ state of each one. It is important that sequences that print be able to show dialogs to assist in troubleshooting printing issues. The script also offers to switch sequences set to ‘Never’ to ‘Optionally’ show dialogs. (v1.0: Dec 10, 2011)
  • Insert Page Setup in Printing Sequences: All sequences that print should have a Page Setup command in them just before the Print command. This script expands on the Find Printing Sequences script by creating a new sequence set to Optionally show the Page Setup dialog (when the Option key is held down) and inserting it just before every Print Form or Find and Print All step in the sequences in a collection. It has a bit of intelligence to avoid adding Page Setup where it already exists, but even so, the modified sequences are opened as they should be reviewed for accuracy. This script also reports on the status of printing sequences, just like Find Printing Sequences, but this script is much more refined and streamlined, for those who study these scripts to learn AppleScript techniques. (v1.0: Feb 12, 2015)
  • Fix Single Step Recursive Sequence: A bug in Helix RADE 6.2.x results in a crash when a single step tail recursive sequence is created. (That is, a sequence whose one step is a call to itself.) This script resolves that crash by inserting a ‘null’ command as the first step in those sequences. You can then delete or edit those sequences.(v1.0: Feb 10, 2016)
Template
  • Clean Up Styled Text Lables: This script removes redundant styled text data from label rectangles. It can fix a single template or an entire collection. (v1.0: Jan 5, 2016)
  • Conditional Style Report: This script creates a text file report detailing the conditional styles used on a single view. (v1.0: Mar 17, 2017)
  • Enable All Grids: This simple script turns on the “Align to grid” property for every template in a collection.(v1.0: Aug 12, 2015)
  • Find Conditional Styles: This script searches every template for data rectangles containing conditional styles and reports on the number found, as well as the number that have mismatched font or size settings. (A common problem when changing a rectangle font is to forget to change the conditional styles as well.) Also includes an option to select the pertinent templates (and relations) for further investigation. (v2.0: Mar 13, 2017)
  • Find Tabbable Controls: This script searches every template for data rectangles that contain a control (radio button, checkbox, menu) and also have the ‘Allow tab’ property set. (The behavior of these rectangles may vary depending on the computer’s Full Keyboard Access setting, making them difficult to use in sequences that rely on Home Field and Tab Field commands. Requires Helix 7.0.2 or later. (v1.0: Mar 27, 2017)
  • Split Multiline Label Rectangles: This script splits selected label rectangles into multiple rectangles, one for each line of text (using the return or linefeed character as a divider). The template’s vertical spacing (grid) controls the spacing of the new rectangles. (v1.0: Jan 12, 2015)
  • Switch Click To Open: This script presents a dialog that lets you quickly switch the entry view to open when a list is double clicked. This script works in user mode as well. (v1.1: Mar 16, 2017)
  • Trim Templates: This script trims templates so there is no extra white space around the rectangles. Updated to handle multiple templates selected in a relation window. (v1.1: Nov 26, 2013)
User
  • Restore User Passwords: This script restores user passwords (stored in a tab delimited text file) after structure application has removed them. It also shows a techinque for preserving a variable in a property, allowing the script to automatically choose the file on subsequent runs. (v1.0: Mar 27, 2012)
  • Remove View From Users: This script removes the currently selected (or open) view from all user menus. (v1.0: Feb 21, 2014)
  • Set View Position for All Users: This script uses the position of the open (and frontmost) view (in Design Mode) to reset the position of that view for all users who have it on their user menus. (Be sure to read the comments in the script for notes about an old bug that may affect this script. (v1.0: Jan 15, 2016)
  • Test Password For Unicode Compatibility: Because Helix 7.0 uses Unicode for text input, passwords that use ‘high-ASCII’ (typed with the option key) characters will fail after upgrading to Helix 7. This stand-alone application tests a password (which you must type) to determine whether it can be converted to Helix 7.0. Those that fail should be changed or removed before updating the collection. (v1.0: Sep 8, 2016)
  • Reset Passwords: Because Helix 7.0 uses Unicode for text input, passwords that use ‘high-ASCII’ (typed with the option key) characters will fail after upgrading to Helix 7. This script resets passwords for selected users to the string of your choosing. Users should be reminded to choose a new password when connecting for the first time after the Helix 7.0 upgrade. The script also checks which users have the Edit Username List… command on a menu, and offers to add it to users of your choosing.Requires Design mode access. (v1.0: Sep 8, 2016)
View
  • Find Disabled Views: This script checks every view in the open collection to confirm that each one is in "Show Form" mode. (That is, that it is ready for use.) After checking the collection, a dialog reports on the findings. v1.1 fixes a bug caused by poor variable name choices. (v1.1: Jun 16, 2012)
  • Open Every Page Setup: Because Helix collections store print record data (specifications made in the Page Setup and Print dialogs) for every view, and because macOS does a fairly poor job of interpreting the “Classic” print record data, the information stored by Classic is sometimes interpreted very poorly by macOS. The solution (unfortunately) is to use Helix RADE 6.2 to open every view, choosing Page Setup and Print Form for each one, and correcting improperly stored settings for macOS. This script assists by automating as much of the work as possible. But you still have to visually confirm the Page Setup and Print dialog settings, and make changes where needed for each view. Version 2.1 adds a self-adjusting delay between the Page Setup and Print Form steps, to avoid “menu not enabled” errors, increases the default timeout from 10 minutes to 1 hour, and uses Notifications (in macOS 10.9 and later) to show progress being made. See also this technote. (v2.1: October 23, 2014)
  • Open My Template: This script opens the template of the currently open (or selected) view. Until we provide a way to get there quickly in the UI, this is the next best thing. (v1.0: Mar 27, 2014)
  • Find All View I/O Paths: This script creates a report showing the import/export file paths stored in every view of a collection. Useful if you want to check that import/export sequences will run correctly. BBEdit or TextWrangler is used to generate the report. (v1.0: Apr 18, 2014)
  • Find Views with High-ASCII Delimeters: When a collection is updated to Helix 7.0, any views whose I/O delimiters are greater than 127 are reset to the default values. This script — which must be run in Helix 6.2.x — checks for views that will be affected by this change. (v1.0: Oct 4, 2016)
Working With Data
  • Record Data Explorer: This script demonstrates the record counting capabilities of Helix via AppleScript. Place it in your scripts menu or open it with your script editor. Then open a collection and run the script. It reports the record count of each relation along with the specific count of defined records for each field in the relation. Version 1.1 updated for current terminology. (v1.1: Jan 23, 2012)
  • Delete Relation Data: This script that demonstrates how to delete data from a collection. It also shows how to present the user with a list of all of the relations in the open collection, how to test the current selection to provide a better user experience, and how to sort the list using the Unix sort. Version 2.0 also works if you are in User Mode, as long as you can supply the name/password of a user with Design Mode access. (v2.0: Oct 17, 2014)
  • Make Max + 1: This script is a ‘time saver’ script: it makes a ‘Max + 1’ abacus for selected number or fixed point fields. It also looks for an index on the field and an abacus for the constant ‘1’ to use in the abacus and offers to make those if they aren’t found. (v1.1: Jan 28, 2017)
Miscellaneous
  • Helix Preference Editor: Some behaviors of Helix applications can be changed by setting preference values. Until there is a built-in interface for editing them, this script lets you change them. See this technote for more details. (v7.0: Dec 21, 2016)
  • Helix Preference Editor for Helix 6: Users of Helix 6 should use this version of the preference editor. See this technote for more details. (v1.5: Oct 16, 2015)
  • Clear Temporary Files: When a Helix collection is closed without saving, a temporary file is left behind, leading to -48 errors when creating a new collection. (This is a bug: see R7173) This script deletes those temp files. (v1.0: Jan 2, 2013)
  • Error Identifier: This is a script that might help you identify the icon that Helix RADE reports as containing an error, should such a thing happen to you. Version 1.4 fixes the error that happens if you enter the object id in hex form. It also changes the name to ‘Error Identifier’, as ‘damage’ was way too overboard. (v1.4: Feb 15, 2016)
  • Make and Delete Icons: This is a simple script that shows how to make and delete icons. It doesn’t do anything useful beyond showing the scripting syntax. (v1.0: Sep 26, 2011)
  • Move Windows Right: This script finds every icon editor window that is positioned so that it would be under the default position of the new Element Panel, and moves it to the right so it will not be obscured when opened. v1.1 adds better progress and error reporting. v1.2 adds an option to open any icon that generates an error, thereby automatically fixing illegal coordinate errors. (v1.2: Jan 13, 2014)
  • Registration Reset: This script resets the registration data for a Helix application, as though it had never been launched on the computer. (v1.0: Mar 26, 2014)
  • Rename Duplicates: This script addresses the same issue as ‘Search for Duplicates’ but it also renames the duplicate icons, appending text to the end of the name. (v1.0: Mar 27, 2012)
  • Search for Duplicate Names: This script searches a collection for icons with identical names, which might lead to ambiguity when addressed via scripting. Only identically named instances of the same icon class within a parent are reported, as that is the only ambiguity. That is: two abaci named "true" in two different relations are not reported, but two abaci named "true" in the same relation are. Version 1.1 trims the dialog when there are too many lines to fit on your screen. (v1.1: Mar 27, 2012)
  • Select In Parent: This script opens the parent icon of the current frontmost icon, selecting that icon in the parent’s window. This is like the “tunnel up” capability you see in Finder when pressing CMD-Up arrow. (v1.0: Aug 13, 2012)
Helix Utlity
  • Simple Maintenance: This script is a simple alternative to Helix Maintenance Manager, which does not work with Helix 6.2 or later. It creates a zip archive of the folder containing your collection, uses Helix Utility to verify and (if necessary) repair the collection, and sends an email report to a specified user. Note: you must edit the properties in this script before it can work for you. (We’ll help if you need us to.) If you create a launchd process to run this script (helpers for that are noted in the script comments) you can have a completely automated backup and maintenance system much as was provided by HMM. (v1.0: Jul 14, 2016)
Non-Helix
  • Make Iterations (Duplicate and Rename): This drag and drop script duplicates any file dropped onto it, adding a number to the name, for making iterative copies. Preferences can be changed to append or prepend the number, and to control how many zeroes the number is padded with. (v1.0: Jul 05, 2016)
  • Winnow Backups: This is a Finder script that monitors a folder and deletes older files, keeping all files that are less than one week old, one file for each of the last 4 weeks, and one file for each month before that. Obviously, this only makes senes if the folder is where recurring backups of a file (e.g: a Helix collection) are stored. (v1.0: Nov 7, 2012)
  • Duplication Timing Test: This script tests the speed of a hard drive in repeatedly copying a file. I wrote this to test whether a hard drive was running slower than it should be (it was) and thought others might find it useful. Run it now to gather baseline data, then later to see if the drive has slowed. (v1.0: Sep 29, 2011)
  • File Size Monitor: This is a Finder script that monitors the size of a file and notifies you (via Growl) when the file size changes. I wrote this when we were tracking down a bug and thought others might find it useful to others. (v1.0: Jul 13, 2011)