On 16 September 2010 13:29, Jan Claeys <li...@janc.be> wrote: > Op maandag 06-09-2010 om 17:05 uur [tijdzone +0100], schreef Tony > Atkinson: >> 3) Link GUI & CLI operations using common syntax >> >> I'm in two minds about including this, >> as this is not a usual use-case for the majority of people >> but I'd love for all GUI applications to be invokable via the CLI, using >> some standard syntax >> I've found that often times I'll use a GUI app to perform some set of >> operations, then I'm wanting to perform the same operations across >> multiple files, and currently I'm forced to find alternative apps of >> automating said operations >> >> Eg. I've recently needed to perform the following operations on several >> hundred photos >> in order for them to blend in with a user-configurable webpage colour >> scheme >> (Making an image whose background gradually fades to transparent at the >> image boundaries) >> - Open image in the Gimp >> - add a transparent layer >> - Select all >> - Shrink selection by 5px >> - Feather selection by 5px >> - Invert selection >> - Clear selection (to transparent) >> - Save as a PNG > >> Surely it should be possible to automate such GUI operations using a CLI >> interface >> and if you've got experience with a specific desktop app, I think it >> would be hugely beneficial if you could keep using the same program both >> on the GUI and on the CLI >> >> for IMG_FILE in $IMG_FILES; do >> gimp-cli >> >> --process="layer-add:transparent;select-all;select-shrink:5px;select-feather:5px;select-invert;select-clear;file-save:${IMG_FILE}.png" >> $IMG_FILE >> done > > Your proposal must have been read and implemented by somebody with a > time machine, as The GIMP's batch mode has been around for years. ;-) > > > I think doing that in a general way with all GUI applications would mean > that you would have to add support for a common scripting engine to all > applications, somewhat like AppleScript on Mac OS, or ActiveX scripting > in Windows. Some applications might need major changes to make that > possible, and in some cases it would significantly bloat them or > (partially) duplicate existing scripting functionality (that can't be > removed for backwards compatibility or because it has more/other > features).
The Amiga had ARexx (Rexx itself came from IBM mainframes). Every "real" Amiga application exposed its functionality via its ARexx port which was basically just a way of delivering strings and get strings back in reply. There is no need to build the scripting engine into every application. ARexx was just a scripting language with a built-in ability to communicate over ARexx ports. I wrote perl ARexx bindings so that I wouldn't have to learn yet another scripting language. These days, using JSON or something like that instead of ad-hoc text commands would probably be best. Being able to script across almost all of your (GUI) apps let people do great things with ARexx. http://en.wikipedia.org/wiki/ARexx All that said, don't DCop for KDE and dbus for gnome provide the basics of this (when the app has bothered to implement them)? F > The first thing to do if you want to see this happening would be to get > all desktop environments to agree on a common system for this (probably > through FreeDesktop.org). Good luck with that... > > > -- > Jan Claeys > > > -- > Ubuntu-devel-discuss mailing list > Ubuntu-devel-discuss@lists.ubuntu.com > Modify settings or unsubscribe at: > https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss > -- Ubuntu-devel-discuss mailing list Ubuntu-devel-discuss@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss