Menu

"Metascripts" and file associations

2016-02-13
2016-02-27
1 2 3 4 > >> (Page 1 of 4)
  • Pier Andrea Serra

    Hi Stefan,
    I'm thinking to a simple manner to launch multiple scripts as "an independent application" bypassing the SC front-end. At moment this operation is possible only by using preconfigured batch files under Windows or bash files under Mac/Linux. My Launcher solution (see the older posts on the argument) is not so reliable.
    I've noted that SC does not have file associations (mime/type) to specific extensions.
    An idea could be to create a XML file (similar to the actual preferece files) which encapsulates the actual status of the scriptWindow plus extra command-line parameters. The extension of this file may be customized (i.e. .sce Sscript Communicator Execute) . It could be possible to create a mine/type association (i.e. a associate/dissociare menu under SC preferences) with specific routines for each OS.
    At program launch SC checks if a .sce file is loaded and parses the content inaccord (similar to prefs parsing).
    The final result could be that when you dobule -click on the .sce file, a SC "application" is launched.
    Several programming tools use this approach (i.e. AutoIt).
    It is like loading a custom configuration file (I think that just changing the extension of an actual XML file and launching the scripts listed inside could be sufficient).
    The custom .sce (XML) file could have also an associated icon.
    Think about this possibility because it could be a great help for users to have this possibility.
    As usual there are only ideas I'm sharing with you for possible future improvements.
    Kindest regards,
    Pier Andrea.

     
  • Stefan Zieker

    Stefan Zieker - 2016-02-13

    Hi Pier,

    this is a good idea (as usual). I put this on my list.

    Best regards,
    Stefan

     
  • Stefan Zieker

    Stefan Zieker - 2016-02-13

    Hi Pier,

    I have created an installer for windows (is the default for windows now). What do you think?

    Best regards,
    Stefan

     
  • Pier Andrea Serra

    Hi Stefan,
    the installer is a good idea and works very well on Windows 7.
    The implementation of an installer is an important step in making a package more professional and to keep a little bit of control on system variables (i.e.installation folders) you can access for "metascript" launching and, in future, for extension and or updates.
    I think that starting from a while the updates will be less frequent and an installer is goog for maintaining an unique (main) copy of the software in the system. Technically speaking you could add a "check for updates" item in the Help menu in the future.
    Thank you again for your efforts.
    Kindest regards,
    Pier Andrea

    ps. you can make an installer also for the optional WebViewLibs and future extensions; in this way is much simple for average users to extend and customize SC.

     
  • Stefan Zieker

    Stefan Zieker - 2016-02-14

    Hi Pier,

    I have uploaded a new pre-release which includes:

    • a new program icon
    • QStringList scriptThread.getScriptArguments(void)
    • the ECS file feature (you can find an example under (exampleScripts\WorkerScripts\TestEcsFile)

    If you set the file association with the windows explorer 'open with' option, then you can double click this file and SC starts (I will add the file association feature in SC later).

    Best regards,
    Stefan

     

    Last edit: Stefan Zieker 2016-02-14
  • Pier Andrea Serra

    Hi Stefan,
    thank you, I'll try the new release this morning.
    Kindest regards,
    Pier Andrea.

     
  • Pier Andrea Serra

    Hi Stefan,
    I've tested the new release with the new .ecs functionality and it works very well under Windows 7.
    I had a small problem with file associations because of the wrong exe directory path on Windows registry (possibly related to my past experiments). As you know sometimes is not so easy to do a file association as reported in several blogs:

    http://answers.microsoft.com/en-us/windows/forum/windows_7-files/problems-with-file-association-in-windows-7-64-bit/8a84fcec-22df-4942-8e35-d98dbe96e327?auth=1

    I've found the solution by adding this key (this could be a suggestion also for your standard future implementation):

    Windows Registry Editor Version 5.00
    
    [HKEY_CURRENT_USER\Software\Classes\Applications\ScriptCommunicator.exe]
    
    [HKEY_CURRENT_USER\Software\Classes\Applications\ScriptCommunicator.exe\shell]
    
    [HKEY_CURRENT_USER\Software\Classes\Applications\ScriptCommunicator.exe\shell\open]
    
    [HKEY_CURRENT_USER\Software\Classes\Applications\ScriptCommunicator.exe\shell\open\command]
    @="\"C:\\Program Files (x86)\\ScriptCommunicator 4.03\\ScriptCommunicator.exe\" \"%1\""
    

    You could do the same also for Javascript files but this is not really necessary:

    Windows Registry Editor Version 5.00
    
    [HKEY_CURRENT_USER\Software\Classes\Applications\ScriptEditor.exe]
    
    [HKEY_CURRENT_USER\Software\Classes\Applications\ScriptEditor.exe\shell]
    
    [HKEY_CURRENT_USER\Software\Classes\Applications\ScriptEditor.exe\shell\open]
    
    [HKEY_CURRENT_USER\Software\Classes\Applications\ScriptEditor.exe\shell\open\command]
    @="\"C:\\Program Files (x86)\\ScriptCommunicator 4.03\\ScriptEditor.exe\" \"%1\""
    

    I suggest you to remove the version of SC from folderName (i.e. ScriptCommunicator 4.03 = ScriptCommunicator) because I think that it will not be necessary to have multiple SC versions installed and to maintain as clean as possible the registry.
    During the installation you could create a REGKey with the installation folder and this key will be the standard reference for future "manipulations" i.e. updates, patches etc.
    As suggested Yestarday also the optional libs could be added with an installer only if SC was previously installed:
    1) Check in the register if and where SC has been installed (and the SC version) and then (if the version is OK)
    2) proceed to the installation of the components by using the REGged folder as basepath.

    I Have a final question: did you generate the .ecs file manually? What do you think about a small dialog (i.e. in the ScriptWindow) for creating/saving the ecs file with all files listed in the table and some options as show/hide the ScriptWindow or Maximized/minimized?

    Kindest regards,
    Pier Andrea

    ps I like the new SC icon!

     

    Last edit: Pier Andrea Serra 2016-02-14
  • Pier Andrea Serra

    Hi Stefan,
    I'm testing the new ECS functionality.
    I've tryed to copy the ecs file to the desktop and launch it. Of course SC generates an error because the PAHTs of scripts in the ECS XML are relative paths.
    The actual implementation works well if the ECS file "goes" wtth the associated JS files (because of the relative path); the entire "app" is fully portable (i.e. contained in a USB key). If you move the ESC file in a different position of the tree you generate path errors (like in my experiment).
    This approach is good but the ECS path is too stricltly linked to the JS files paths ( and they could be very different!) and the resulting "app" may be difficult to use and/or to port to another computer (you have to copy the exact tree).
    A suggestion about this point is to think as a real "App" distribution.
    1) Ask the user to select (or create) a folder for savng the "app"
    2) create a subfolder "scripts" and copy inside it all scripts (and UIs) in the scriptWindow Table
    3) generate the file ECS in the root of the selected folder pointing to the portable scripts (ROOT/scripts)
    In the tree you can add extra folders as media, prefs, include etc (but this could be defined by the user).
    This approach is great, self containing and widely used.
    In future releases you could ZIP the entire folder (with all files inside), change the extension (ZIP=ECZ) and, after ECZ association with SC, the SC could open the zip file in a temp dir, and then launch the ECS file inside as a real, one-file distribution (an example of this approach is the great LUA game engine Love2d (https://love2d.org/).

    On the other side you could have SC-related files (JS includes, media etc) these files will be available to the programmer in a SC version-dependant manner and the path, in this case, is related to the SC installation and not the the ECS path.

    I think that also now it is possible to access to the SC path, but, just in case,a solution to this problem could be to add a routine:

    QString scriptThread.getScriptCommunicatorFolder(void);
    

    the used will have the responsability to manage "shared resources" from inside the script.

    It could be important to think to all these possibilities before to start the development of ECS functionality because it is so powerfull that it is better to stop-and-think a littlel bit more now that in the future.

    Thank you for your attention.
    Kindest regards,
    Pier Andrea.

     

    Last edit: Pier Andrea Serra 2016-02-14
  • Stefan Zieker

    Stefan Zieker - 2016-02-14

    Hi Pier,

    I will add/mplement following:

    • remove the version from the SC folder
    • search the SC folder during installation and use this as the default path during installation
    • add 'create SCE' dialog
    • copy all files and UIs to sub directory of a user defined folder (create SCE) and create the SCE file in the root of the user defined folder
    • introduce the SCEZ file type which contains the complete SCE folder as zip file
    • add QString scriptThread.getScriptCommunicatorFolder(void)

    This are really good ideas!

    Best regards,
    Stefan

     
  • Pier Andrea Serra

    Hi Stefan,
    I'm very happy that we share the same entusiasm for your creation. For me is a great plesure to "work" with a so clever Person.
    In this particular case, immagine how simple will be to share SCEZ files as complete working communication apps among Mac, Win and Linux!
    Thank you again.
    Kindest regards,
    Pier Andrea

     

    Last edit: Pier Andrea Serra 2016-02-14
  • Stefan Zieker

    Stefan Zieker - 2016-02-14

    :-)

     
  • Stefan Zieker

    Stefan Zieker - 2016-02-15

    Hi Pier,

    I have uploaded a new pre-release which includes:

    • a create SCE dialog->in the moment I'm working on the zipped file type
    • scriptThread::getScriptCommunicatorFolder

    Best regards,
    Stefan

     
  • Pier Andrea Serra

    Hi Stefan,
    great, I'll try the new release ASAP.
    Thank you,
    Kindest regards,
    Pier Andrea.

     
  • Pier Andrea Serra

    Hi Stefan,
    I did preliminary tests; first of all my compliments for the interface is much better than my original idea.
    I have few suggestions:
    1) Remember to include not only the JS files but also the UI files; you have two alternatives:
    a) automatically check if a JS has an UI file and include it
    b) Do an explicit include of UI files (in this case add the UI file type in the file selecton dialog).
    2) You can directly include to the SCE Dialog file list (the first time you open it) all files present in the ScriptWindow table (JS and UI) in this manner one prorammer could simplify the SCE generation without the tedious loading of all files (it is much simple to delete than to add files); Alternatively you could save the file list in the preferences and reload it at next session (Hopfully a programmer will work on a projet at time).
    3) You could (optionally) add a third list for extra resources (include files, lib files, executable files, media files, preferences etc.) define the file type (during selection) as "*.*" and copy the selected files in a subfolder like "("resources" or "extra" or "media" etc). In this way the SCE GENERATION IS COMPLETE. This could help you also for the generation of the ZIPPED folder because all files will be included in a transaprent way by inside SC and SC will know every aspect of the final app.

    You are doing a great job.

    Thank you.
    Kindest reagards,
    Pier Andrea.

    PS INCLUDE IN THE SCE GENERATION DIALOG THE MINIMUM SC VERSION REQUIRED FOR THE EXECUTION OF THE SCE; This will be important for checking the availability of shared resources now and in future releases.

     

    Last edit: Pier Andrea Serra 2016-02-15
  • Stefan Zieker

    Stefan Zieker - 2016-02-15

    Hi Pier,

    I will keep your comments in mind.

    Best regards,
    Stefan

     
  • Stefan Zieker

    Stefan Zieker - 2016-02-15

    Hi Pier,

    I have uploaded a new pre-release which includes an improved creation of a sce file. The next thinks on my list are:

    • loading an sce file in the create sce dialog (if you want to change an existing sce file)
    • the minimum SC version
    • the SCEZ file format
    • new scriptThread (zip-) functions: archiveDir, archiveFiles and extractFile

    Best regards,
    Stefan

     

    Last edit: Stefan Zieker 2016-02-15
  • Pier Andrea Serra

    Hi Stefan,
    great , great job.
    I had the same ideas about the zip functionalities because they will be available for the SCEZ format... I'm worried about this strange" telepathic connection"...
    ...is this a new level of "ScriptCommunication"?
    Kindest regards,
    Pier Andrea.

     
  • Stefan Zieker

    Stefan Zieker - 2016-02-15

    :-)

     
  • Pier Andrea Serra

    Hi Stefan,
    I've tested your last solution and I found it very functional.
    I've tryed to overwrite previously-written SCE file(s) and all was OK; the oly warning is that SC does not remove existing files from the script sub-folder (if their name is different from the newly loaded files).
    You can clean (or remove and re-create) the script folder before copying the scriptfiles in it.
    Kindest regards,
    Pier Andrea.

     

    Last edit: Pier Andrea Serra 2016-02-15
  • Stefan Zieker

    Stefan Zieker - 2016-02-16

    Hi Pier,

    I put this on my list.

    Best regards,
    Stefan

     
  • Stefan Zieker

    Stefan Zieker - 2016-02-16

    Hi Pier,

    I have uploaded a new pre-release which includes the fully implemented SCE and SCEZ files formats.

    Best regards,
    Stefan

     
  • Pier Andrea Serra

    Hi Stefan,
    I'll try teh new release asap.
    Thank you.
    Kindest regards,
    Pier Andrea.

     
  • Stefan Zieker

    Stefan Zieker - 2016-02-17

    Hi Pier,

    I have uploaded a new pre-release which includes some SCE related bug fixes.

    Best regards,
    Stefan

     
  • Stefan Zieker

    Stefan Zieker - 2016-02-17

    Hi Pier,

    I have uploaded a new pre-release which includes some SCE related bug fixes.

    Best regards,
    Stefan

     
  • Pier Andrea Serra

    Hi Stefan,
    Your solution is quite complete; I like the solution you have found for loading different filetypes in different directories.Actually it is not possible to create subfolders like "scripts/include/". I've found some problems in accessing to other files from inside script/ folder.
    I've tryed with the following relative path "../extra" with some problems.
    Today I do other tests.
    THe SCEZ format is powerful as expected.
    Overall, this functionality is quite OK and I think it is a big improvement in making portable apps.
    Kindest regards,
    Pier Andrea.

     
1 2 3 4 > >> (Page 1 of 4)

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB