You will notice that, in the result of the above code, the window's name contains the suffix (Indexed), following the graphic file's name. > window "mt_logo_209x043.gif (Indexed)" of application "GraphicConverter" The following code will retrieve a reference to the frontmost graphic window. Rather, a graphic is referenced using the window class. When AppleScripting GraphicConverter, there is not an actual graphic class. For example: tell application "GraphicConverter"įigure 1. GraphicConverter also has the ability to download and open an image using a URL, rather than referencing a local file. checkbox in the dialog, in order to prevent that specific dialog from appearing again in the future. TIP: When using the silentopen command, if you still encounter a dialog when opening a certain type of file, be sure to select the Don't show this note again. While this command may not prevent all dialogs from being displayed, it can certainly help to reduce the possibility of one appearing and holding up your automated process. At times, opening certain graphic files may cause a dialog or error message to be displayed, and the silentopen command will attempt to open a specified graphic file without displaying such a dialog. set theImage to choose file with prompt "Please select an image file:"Īlthough the open command will usually suffice, you may actually want to consider using the silentopen command instead. The following example code demonstrates the usage of this command. Like most applications, GraphicConverter has an open command, which may be used to open graphic files. There are a few different ways that graphics can be opened in GraphicConverter via AppleScript. I would encourage you to explore GraphicConverter's AppleScript dictionary carefully to learn more about these and many other scriptable functions that we won't have a chance to touch on in this month's column. The reason I say most likely is because there are actually ways to batch process and interact with graphic files using GraphicConverter and AppleScript without writing code to open them. Whether you plan to automate GraphicConverter for the purpose of converting graphic files from one type to another or for manipulating graphics, you will most likely need to open them first. Also, in case an updated version of GraphicConverter introduces AppleScript changes before this month's column is published, please note that all code that follows was written and tested with GraphicConverter version 5.9.1. Just be sure to review the release notes in order to determine which AppleScript changes, if any, have been made between versions. In any case, to ensure the highest level of AppleScript support, it is best to ensure that you are using the latest version of GraphicConverter. Lemke Software updates GraphicConverter on a very regular basis, and many of these updates include changes to its AppleScript terminology, which may require that you make changes to existing scripts. For the cost of the non-demo version (currently only $30 for a single user license!), you may find it well worth adding to your software collection, especially if you plan to automate graphic conversion and manipulation with AppleScript, but don't need all of the functionality of something like Photoshop. If you are not yet familiar with GraphicConverter, or if you plan to follow along with the examples in this month's column, then I encourage you to download the fully functional demonstration version of GraphicConverter from the Lemke Software website at. Furthermore, many features of GraphicConverter are controllable via AppleScript. It also possesses the ability to manipulate graphics by rotating them, scaling them applying filters, and more, many of the types of tasks that users often want to automate in order to batch process their graphic files. One of GraphicConverter's great fortes is converting graphics from one type to another, hence its name. GraphicConverter supports opening approximately 190 different graphic file formats, and saving approximately 79 different graphic file formats. While not packed with all the bells and whistles of something like Adobe Photoshop, GraphicConverter does offer quite a lot of bang for your buck. This month, we will discuss scripting GraphicConverter, another popular graphic conversion and manipulation application, which is available from Lemke Software GmbH. Specifically, we looked at Adobe Photoshop, and explored how opening, manipulating, and saving graphic files can be automated using AppleScript. In last month's column, we began discussing scriptable creative applications. Introduction to Scripting GraphicConverterĬolumn Tag: AppleScript Essentials Introduction to Scripting GraphicConverter Educational Institution and Student Discounts.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |