Software Articles

March 5, 2011

Any Experienced User Can Master InDesign Scripting

Filed under: InDesign, JavaScript — Tags: , , , , — admin @ 12:56 am

InDesign is widely acknowledged as the industry standard in print and publishing software. It has a huge range of functions and a large base of users, many of whom have an in depth knowledge of the program. Anyone who uses the program regularly, especially those who use it for fairly challenging tasks, will welcome the ability to automate some of their workflows. However, there is no easy way of achieving this in InDesign.

The recordable actions facility found in Photoshop and Illustrator simply does not exist in InDesign. Instead, InDesign allows the user to write executable scripts using a choice of three programming languages: JavaScript, AppleScript or Visual Basic. The major benefit of using JavaScript as the programming language is that it is cross-platform: scripts will run equally well on Windows and Macintosh.

For anyone working in a Mac-only environment, AppleScript will be the obvious language of choice. It offers the benefit of easy integration with scripts written for automating other programs on the Macintosh platform, for example, extracting information from FileMaker and then taking it into InDesign.

For anyone interested in automating InDesign on the Windows platform, Visual Basic is the logical choice. Additionally, it is possible to control InDesign using Visual Basic for Applications (VBA), a variant of Visual Basic which is used to automate Microsoft Office. This option would be ideal for someone automating the production of financial reports heavily reliant on Microsoft Excel spreadsheets.

Be forewarned that, in order to be able to control the program with scripting, you must know InDesign CS5 very well. This is essential; since it is impossible to understand many of the subtleties of the InDesign object model without an intimate knowledge of the elements of InDesign which these scripting objects represent. Basically, in order to automate InDesign, you need a good knowledge of three elements. Firstly, InDesign: the program and all its major functions. Secondly, a compatible scripting language such as JavaScript. Thirdly, the InDesign object model: the programming syntax which is used to represent every nook and cranny of InDesign itself.

InDesign CS5 Automation Using XML & JavaScript by Grant Gamble is available now from Amazon.

August 27, 2009

Using DataBound Controls In ASP.Net 3.5

Filed under: ASP.Net — Tags: , , , , — admin @ 10:32 am

Displaying data on a web page which is bound to information in a database is a very common requirement in web applications. In ASP.NET version 1, the main control for achieving this was the DataGrid. In the current release of ASP.NET, version 3.5, the DataGrid is conspicuously absent from the Toolbox in Visual Web Developer. In fact, although the DataGrid can still be used in ASP.NET pages and will work fine, it is now deprecated. The good news is that there is a good choice of more powerful new controls which have taken its place. Four of these controls (GridView, DataList, Repeater and List View) are suitable for displaying multiple records from a data source and then there are another two (FormView and DetailsView) which are used to display only one record at a time.

The GridView control is the workhorse of ASP.NET’s DataBound controls. It displays data items in an automatically-generated table and has a rich set of easily-configurable options.  Options include the ability to customize columns and to include custom content in columns such as images or any other relevant HTML column. Command columns can also be added containing links which will enable the user to edit and delete records. The control also supports paging and sorting.

The DataList control also automatically generates a table when it produces its output. However, unlike the GridView control, it allows the display of more than one record per row using its RepeatColumns property. The DataList is also template-driven, requiring the use of an ItemTemplate containing dynamic data. The elements placed inside the ItemTemplate are rendered once for each item in the bound data.

The Repeater Control also uses an ItemTemplate element to format its output. However, since it does not automatically generate a table, it offers considerable flexibility of layout. Output can be rendered as paragraphs, as a series of DIV elements, an ordered list, an unordered list or a customized table.

The ListView control, introduced with ASP.NET 3.5, also uses templates for displaying its output. However, it is far more sophisticated, allowing the use of a variety of templates, for example: a LayoutTemplate for specifying the overall container for the data; an ItemTemplate for specifying the rendering of each item of data; an ItemSeparator template, used to specify the content displayed between items of data; and so on. The ListView control also supports paging, sorting and editing records as well as the creation of new records.

Of the two controls used to display single items of data, the DetailsView resembles GridView in that it displays its output in an automatically-generated HTML table. The other single record data bound control, the FormView, resembles the ListView control, in that it is entirely template driven. Both of the single record controls support paging and sorting and allow you to edit and delete records as well as adding new ones.

Author’s company runs ASP.NET training courses in London and throughout the UK.

Powered by WordPress