Script generation using GUI - user-interface

Is there an example for a project a GUI fro script generation?
The idea is to let a non-programmer use a front end to enter command and simple logic that will translated to runnable
scripts.
The programming language does not meter.
thanks

I would use Qt + python, but the constrains you give are too general. simple logic could not be simple at all.

One of the best example of a GUI that generates scripts that I've seen so far is Apple's Automator. It's good not in the sense that it is has lots of features but that it is intuitive enough that many non-programmers use it to automate tasks. It is basically a flashy implementation of the unix pipe paradigm.
Another successful tool in term of getting non-programmers to write programs is Adobe Photoshop's Actions. It also basically emulates the unix pipe paradigm.
I've personally never seen anything that breaks the pipe paradigm successfully convince non-programmers to write programs. Apart from Excel spreadsheet equations of course - but that is just horrifying to write programs in.

There's no script behind the scenes, but the Grasshopper plug-in for the Rhinoceros CAD system allows you to create algorithms purely visually.
Grasshopper User Forums
It's got an extensive Video and Image gallery which often features the GUI.

I assume you ask for education purposes. Then LOGO is a good option (targeted towards children though).
Edit:
As you say, you want such a thing for an enterprise-like application. I'd go for some markup format such as YAML or XML. The script would be directly editable and be in a well-known language such as Python or Groovy. There might be existing GUI tools for markup languages. If you take this approach, please let me know good examples of such GUI tools.
Specifically for business rules of course there are things like Drools.

Related

Interact with GUI Elements of a Windows Application

First of all, I want to appreciate the work for the SCIDvsPC Project. I know that the basic SCID one has been discontinued many years back and the developer have done a great job with expanding it and doing his share for the Chess Field. We have a Minor Project to do in this 6th semester of our college. We've decided to start a project on a Chess Next Move Analyzer that is based on variety of filters and implements Self Learning and Machine Learning.
I've been researching over the project idea for the last 2 months. Actually we need to import several games defined on some filters and read and analyze from the PGN file generated. For example, if the user chooses to get the next best move predicted according to the rating range of 2000-2500, our program should only export and analyze the PGN files that have both the opponents from this range only. I know the project can do all this but I'm confused over how to automate this. I mean I have to manually enter the moves and then click on 'Generate PGN' but how to make my program do this ie take input from the user (like first 3 moves), make the project run these moves (what I had to manually) and then generate the PGN file and keep it in a folder.
I've surfed the net about interacting with GUI elements in Windows (we have no problem in working with Linux either) and came to know about Microsoft UI Automation, Python, Java and C# softwares and something like COM. Do the software support COM or any one of these or have you already developed some functionality like this? Please can you guide me over this?
If asked to Generalize this what I want to do is to interact with GUI Elements, be it any application. Take Notepad as an example. Suppose I want to open a file on it, find and replace a particular word. Now, I know how to do this manually but when I have over thousands of file I need some kind of program to do this for me. Do some specific programs like SCID in my case has some feature (read bit about COM) pre-built to handle this? In which programming language domain does this come into? Is using Linux help me more?
Take Notepad as an example. Suppose I want to open a file on it, find
and replace a particular word. Now, I know how to do this manually but
when I have over thousands of file I need some kind of program to do
this for me. Do some specific programs like SCID in my case has some
feature (read bit about COM) pre-built to handle this?
Your situation sounds to be quite specific so I doubt whether you will be able to find a pre-existing program to do this for you. Meaning: you'll have to code it yourself.
In which programming language domain does this come into?
Well, this could probably be done in many, many different programming languages. A simple shell script would be able to achieve the Notepad example you gave.
Is using Linux help me more?
No, your goals seem to be pretty achievable by a simple shell script, whether you write it in a Windows, macOS or a Linux distro.
#SB87 gave you some useful hints, I'd like to expand his answers.
Sorry, I don't think you know what you're talking about. Reinforcement learning (better term than self-learning) and machine learning are not something suitable for a college project. It's at the PhD or research level, consider getting yourself into university before even thinking about anything like that.
UI automation is possible, but error prone and slow. If you want to do it, you'd write a console program. You mentioned something about user inputs, do you mean you want to apply machine learning on user mouse-keyboard inputs? It's not going to work. Machine learning for chess requires hundreds and thousands of training set.
I think you should downplay the project and focus on something you can achieve.

Any recommendations for writing a GUI client from a CLI client?

I'm looking for writing a GUI client for a existing application in my job, this application is CLI and because this is not widely used.
This is the first time I'm writing something similar, the I ask you for recommendations, books, techniques, methodologies, advices. My first approach is to create the interface and to make calls to the original CLI client, is this a congruent approach?
Though it's not ideal, I don't think it's a bad approach, creating a GUI shell for your CLI app. In this design, the GUI acts as the CLI program's user. You have to consider things like:
Can the GUI anticipate or understand
all possible CLI program output? How about errors? How
complex will that be? Consider
parsing Unix "ls" output. Simple enough. How
about Windows command prompt "dir" output? A
bit more funky.
The CLI program may take time to
execute, this must be presented in
the GUI. The GUI may have to prevent
the user from running another instance of the CLI.
You might want to consider tcl/tk. I've written several successful commercial GUIs that work in exactly this manner.
I'll admit that it maybe takes a little skill to craft a stunning GUI but it's not impossible, and not even that hard. You won't be able to reproduce the eye candy of flash or silverlight, and if that is important this might not be the right solution for you.
If, on the other hand, you are more concerned with Getting The Job Done, tcl is a very viable choice. It's easy to learn and easy to I integrate with command line tools.

Is there any special tool for interactive GUI development

Currently I am preparing exercises about networks and mobile communications for students. I was thinking about creating an interactive user-interface which enables the user to drag&drop predefined elements and then implement a logic based upon element distances etc.
An example would be to place two base stations (a predefined element with several properties), set the scale in the interface and then check the signal interferrence in the environment (user-interface).
The first part might be too abstract whereas the example might be too specific, but I was wondering whether there already exists any friendly framework or language which enables developers to create interactive interfaces (for teaching/learning purpouses) in short ammount of time. Usually I write applications for PC environment in .NET but in this case it would take too much time to create a specific interface for every exercise.
I would appreciate if anyone could suggest any way to create interactive user-interface in short ammount of time. Are there any special programming languages or development tools for this kind of applications or are there any useful frameworks for .NET, Java or any other language to speed up the development of user-interfaces?
Thank you!
Perhaps sketchflow could be of interest
although more intended as a tool for mocking up GUI's. It does also have the ability to hook up behaviours and other short snippets of code to your testgui.
Take a look at Mockingbird. I'm not sure if it's exactly what you are looking for, but it is a pretty sweet web application and works well for the development of UIs (at least the wireframes).
There are lots of tools for this purpose -- but most of them only work well if your user interface follows one of a few fairly well-defined (and widely used) patterns. Just for example, if you're creating a database front-end, there are quite a few tools to make the job quite easy.
One often-overlooked tool for this kind of job is Visio. Visio is normally thought of primarily for drawing and diagramming, but you can also attach behaviors to objects so double-clicking an object can run a macro of your choice, opening forms, doing calculations, etc. The macros are (at least normally) written in VBA, which probably isn't the greatest choice for big projects, but as you said, for a situation like this you're mostly interested in short snippets.
There are, of course, a number of downsides to this, such as the inability (at least AFAIK) to deploy such a diagram as a web-based application. Like Henry Ford's "they can have any color they want as long as it's black", you can respond to any user action you want as long as it's a double-click.
Microsoft expression blend might bee something cool too
http://www.microsoft.com/france/expression/default.aspx

What is applescript and what is it used for?

What is applescript and what is it used for?
Applescript's "big advantage" over other scripting languages (which, frankly are much better to use for most tasks) is that it can automate the action of other applications on your Mac (as long as the developer has provided an Applescript dictionary).
This means that, as Philip Regan described, you can get an application like Photoshop to perform a whole bunch of repetitive photo modifications and then tuck those photos away in a folder, for example.
Other than that, one of the notable features of Applescript is its "English-like" syntax. Apple intended for it to be used by everyday people and tried to make its syntax as close to English as they could. This intention ran into a lot of problems, not the least of which was getting the people who were creating Applescript dictionaries for their applications to respect this goal. Apple also originally intended for there to be an Applescript for other human languages as well and there was work done on a "French Applescript" if I recall correctly.
There are now libraries in scripting languages like Python and Ruby for interfacing with Applescript so you can control the applications using Python or Ruby syntax and not using Applescript syntax (which can be extremely annoying to learn for someone coming from a programming background because of its irregularities and "foreignness").
Apple's latest move to bring application scripting to the everyday user is Automator. I suggest you try it out, as it can be quite useful if your aims are encompassed by things everyone does (keep copies of webpages, etc, etc,)
AppleScript is a scripting language that can be used to automate actions on Macintosh computers.
Examples of actions that can be automated with AppleScript include filesystem operations, textual data parsing, running programs and invoking program functionality.
Applescript Wikipedia Entry is a good start
While I concur with the rest of the responders here—there are far too many other websites that have this information—I will tell you what I, personally, actually do with it to hopefully give a more practical understanding of what it can do as opposed to the academic or marketing definitions you'll get at other sites...
I manage a production department for a publishing company and I have dozens upon dozens of scripts that allow me to streamline and/or automate all sorts of processes including:
fully automated page layout of marketing materials, contact sheets, and simple book designs using Excel, XML, and InDesign.
large scale image conversions (typically hundreds of images) with Illustrator and Photoshop.
automatic clean up of files (names, types, and some folder structures) to prep them for archiving.
Essentially, I use Applescript to automate any repetative task so that my folks can do better things with their time than repeating the same mindless mouse clicks over and over again. We just drop the files onto the slave Mac, start the script, and it beeps when it's done.

Macro/Scripting language for non-developers with a simple GUI-based editor

We wish to provide people to be able to add some logic to their accounts(say, given a few arguments, how to compute a particular result). So, essentially, this would be tantamount to writing simple business rules with support for conditionals and expressions. However, the challenge is to provide them a simple online editor where they can create the logic (preferably) by completely visual means (drag/drop Expr-tree nodes maybe -- kinda like Y! pipes).
Does anybody know of a scripting/macro/domain-specific language that lets people do this? The challenge is the visual editor, since we don't wish to invest in developing the UI to do the editing. The basic requirements would be:
1. Embedded into another language, or run securely (no reboot -n or <JUNK-DANGEROUS-COMMAND> >> ~/.bashrc)
2. Easily accessible to users without coding background (no need of any advanced features)
3. Preferably have a simple GUI based editor to create the logic programs accessible to non-developers (kinda like spreadsheets)
4. Some ability to generate compile-time warnings (invalid code) would be good (Type safety?)
5. Ability to embed some data before execution which is available to the interpreter (Eg., name, birthday, amount)
Anybody tried doing something like this and got any ideas? I looked at Lua, Io, Python, Ruby and a host of others, but the challenge essentially is that I don't think non-programmers will be able to understand the code all that much. Something that could be added via "meta-programming" to say a Ruby would be good as well, if an editor could be easily developed!
As a matter fact, Microsoft is developing Oslo, which is right up your alley.
Chris Sells has been writing a lot about it recently.
It is designed to be a way to author DSLs and also to visually author these models with a graphical tool called Quadrant. Sounds very very similar to what you are looking for.
Open source wise, Ruby I think can be close, as you can see if you look at _whytheluckystiff's Try Ruby or Hackety.
I don't think you'll find anything that isn't too generic, especially regarding the GUI editor. There's no generic tools as far as I know that will be able to automatically interface with your program and be able to query data from it and interpret the script into commands in your software -- if there is I'd like to have a copy. Not being flippant, but you will have to do some (probably alot) of work to get this working. It will probably result in you writing a custom DSL.
I would take a look at PowerShell. You could surface all the activities a user would like to script in a very readable way.
There is some talk of using PowerShell to create a DSL on the PowerShell team blog and Bruce Payette, the technical lead, talks about this in his book Windows PowerShell in Action from Manning.
At the other end of the scale is to write something simple as a HyperText Application (HTA) -- assuming Windows of course -- along the lines of my Clive tool. The article on the blog doesn't mention the HTA version, but essentially I could enter VBScript-ish code into one textarea and interpret it on the spot, output going into another text area on the form.
With HTAs giving you all the form control of HTML, plus the DOM, you could come up with something interesting fairly quickly.

Resources