The script for this week is going to be another request by a customer. It is a good example of how to search for patterns in HTML and replace the content matching that pattern. A common task when converting an HTML document is trying to get indented paragraphs to indent at the same level. This is especially problematic when the document contains numbered paragraphs that are not hanging (such as a legal outline.) Dealing with this case isn’t exactly trivial in HTML, as it often imports with a set number of non-breaking spaces to create the indent. Unless you’re using a monospace font, the text will not perfectly align, and the outline will not look the same for every number. The best solution is to remove the non-breaking spaces, and wrap the lead-in text (the “(a)”, or “1.”, or “Section 1.”, etc) with a inline tag, using the display type “inline-block”. This, combined with a fixed width and “nowrap” properties, allows us to add a block of space that is a fixed width into a paragraph, so our lead-in text takes up exactly the right amount of space.
Continue reading "LDC #41: Align Outline Text" »Friday, June 23. 2017
LDC #40: Edit Objects
Today we’re going to be talking about the Edit Object. Every edit window in GoFiler that is based on text, as well as some that aren’t, interacts with an Edit Object. An Edit Object allows GoFiler to have a standardized way of communication with other windows, processes, and functions, as well as with the content of the edit window. Legato can work with an Edit Object in a couple of ways, allowing us as a developer to get data about what is showing on the screen as well as change some of that data.
Continue reading "LDC #40: Edit Objects" »Friday, June 16. 2017
LDC #39: Application Initialize Script
So far, every script we’ve explored has been a hook of some sort. They attach themselves to new or existing menu icons or are triggered by other functions being run. What if you want something to run on application start? Legato supports this through the Application Initialize script. On program start, GoFiler will always run the ApplicationStartup.ls script. This script file is the one that’s responsible for running every other script in the extensions folder. This allows users to create their own custom startup routines that are run before literally anything else.
Continue reading "LDC #39: Application Initialize Script" »Thursday, June 15. 2017
Styles Come and Go; Consistency Is Timeless
A taxonomy style guide isn’t about creating a memorable “style”. The style guide is about building clear, transparent, understandable standards that result in predictable communication every time. XBRL relies on a taxonomy of concepts to identify facts, contexts and other relationships. Any ambiguity in the language used within that taxonomy to communicate data, could produce inconsistent results.
Continue reading "Styles Come and Go; Consistency Is Timeless" »Friday, June 09. 2017
LDC #38: Save and Open Dialogs
This week we’re going to talk about using save and open file dialogs with Legato. While previous posts have used these functions in scripts, we’re going to go into a lot more detail about what you can do with these dialogs this time. This is going to be a fairly limited blog in terms of code as it is difficult to create example scripts of save and open file dialogs without doing a lot of extraneous coding. As a result, this blog will contain a number of small snippets of code that are all examples of using dialogs but not a full example script. If you would like a full script using a file dialog, check out this previous script which inserts text into an HTML edit window.
Continue reading "LDC #38: Save and Open Dialogs" »Friday, June 02. 2017
LDC #37: Automated Test Filing XBRL, Part 2
Last week, we created a way to create template files for test filing XBRL in GoFiler. We also designed a method to open and edit them easily. Now it’s time to add the next level of functionality to this project: a script that allows us to test file XFR files with a single button press. This script will create a pair of new folders in the same directory as the XFR file: “Automated Test File” and “Automated Test Archive”. The first folder will contain the most recent test filing, while the latter will contain a copy of every test filing submitted to the SEC just in case it’s needed for future reference.
Continue reading "LDC #37: Automated Test Filing XBRL, Part 2" »