Results 1 to 7 of 7

Thread: User-Utilities in thinAir

  1. #1
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Philippines
    Age
    47
    Posts
    1,218
    Blog Entries
    1
    Rep Power
    132

    User-Utilities in thinAir

    I wish thinAir would have the ability to launch user-utilities on currently open script.
    (see image)
    the blue bordered box shows the thinAir-path on my C:\-Drive with some new created folder ("Utilities") inside.
    There the users could place thinBasic-scripts or executeable files (custom utilities)

    The content of this folder (.exe & .tBasic files) would be listed in thinAir-menu Tools\Utilities as the image shows

    If click onto for example "myUtil.exe",
    thinAir would shell this file and add the current scripts fullpath & -name (highlighted orange in titlebar of thinAir) as a command-parameter, so in this case it were alike

     OS_Shell("C:\thinBasic\thinAir\Utilities\myUtil.exe C:\Users\René\Desktop\Documents\thinBasic\TBGL_Basics\testproject_009.tBasic" , _
               %OS_WNDSTYLE_NORMAL, _
               %OS_SHELL_ASYNC)
    
    Of course thinAir should save all scripts before running the user-utility.
    Would this be possible to implement?
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	thinAir_Utilities.png 
Views:	88 
Size:	55.1 KB 
ID:	9330  
    Last edited by ReneMiner; 05-10-2015 at 09:39.
    [TABLE="class: tblf1 tblf-fullwidth tblf-alternate"]
    [TR]
    [TD][COLOR=#b22222][B][SIZE=1]The limit is[/SIZE][/B][/COLOR][/TD]
    [TD="class: isRelinked"] [COLOR=#0000cd][B][SIZE=1]Imagination[/SIZE][/B][/COLOR][/TD]
    [/TR]
    [/TABLE]

  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    50
    Posts
    8,128
    Blog Entries
    2
    Rep Power
    10
    Wow Renč,

    I think you find the way I could implement thinAir scripting. I was searching for a way to use thinBasic language as a programming language for thinAir and you gave me the idea. Fantastic.

    thinAir has already not documented way to execute scripting able to partially interact with thinAir.

    For example if you open the following example and execute it using right click on its tab and then choose "Execute script inside thinAir" (see attached image) this will load the script not as a separated process but inside thinAir itself using thinCore.dll as an internal programming language (to give the idea ... similar to VBA for MS Office application). Doing that it it possible for thinAir to pass to the script some thinAir inside objects to which it is possible to interact.

    I can use an XML format similar to thinAir script templates so we can add additional info to the script.

    Great, thanks.
    Next version will have it!

    '---ThinAir scripting test
    Uses "Console"
    
    String  sSep   = String$(79, "-")
    Long    nMDI
    Long    lCounter
    
    PrintL sSep
    PrintL "App_Path      :", APP_Path
    PrintL "App_Path      :", APP_Name
    PrintL "App_SourcePath:", APP_SourcePath
    PrintL "App_ScriptPath:", APP_ScriptPath
    PrintL "App_ScriptName:", APP_ScriptName
    
    PrintL sSep
    nMDI = thinAir_MDI_Count
    PrintL "Number of MDI:", nMDI 
    For lCounter = 1 To nMDI
      PrintL "MDI", lCounter, ", file name:", thinAir_MDI_GetFullFileName(lCounter)
    Next
    PrintL sSep
    
    PrintL "---press a key to close---" 
    WaitKey
    
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	thinAir_Scripting.PNG 
Views:	41 
Size:	118.7 KB 
ID:	9331  
    Last edited by ErosOlmi; 05-10-2015 at 21:31.
    www.thinbasic.com | www.thinbasic.com/community/ | psch.thinbasic.com
    Win10Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

  3. #3
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Philippines
    Age
    47
    Posts
    1,218
    Blog Entries
    1
    Rep Power
    132

    Post

    I hope you understood me correct

    Another thought to it:

    thinAir could shell the utilitiy also in %OS_SHELL_SYNC-mode and wait for the result. (Long mostly as TBMain() will return this type by default)
    As simple as
    Long lResult = OS_Shell("C:\thinBasic\thinAir\Utilities\Sync\myUtil.exe C:\Users\René\Documents\thinBasic\testproject_009.tBasic" , _
                        %OS_WNDSTYLE_NORMAL, _
                        %OS_SHELL_SYNC) _
    If lResult And 1 Then 
         ' >>> thinAir shall reload the script 
    Endif
    If lResult And 2 Then 
         ' >>> thinAir could reload the script and all included files 
    Endif
    
    If lResult And &HF0000000 Then
         ' >>> restart thinAir 
    Endif
    
    You might add other result flags as you have ideas...

    if both %OS_SHELL_SYNC & %OS_SHELL_ASYNC are thinkeable then having two subfolders to shell from like

    "C:\thinBasic\thinAir\Utilities" & { "\Sync" | "\Async" } were a simple way to select this.
    Last edited by ReneMiner; 07-10-2015 at 20:33.
    [TABLE="class: tblf1 tblf-fullwidth tblf-alternate"]
    [TR]
    [TD][COLOR=#b22222][B][SIZE=1]The limit is[/SIZE][/B][/COLOR][/TD]
    [TD="class: isRelinked"] [COLOR=#0000cd][B][SIZE=1]Imagination[/SIZE][/B][/COLOR][/TD]
    [/TR]
    [/TABLE]

  4. #4
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Philippines
    Age
    47
    Posts
    1,218
    Blog Entries
    1
    Rep Power
    132
    i would like very much if thinAir could react on a utilities exit-code
    (so run SYNC to wait for a result)

    2 more switches could be handy:

    ' proceed the reload-switches (if any) before this
    
    If lResult And 4 then
      ' >> thinair shall execute the current script now
    ElseIf lResult And 8 then
      ' >> thinair shall execute the current script in Debug-Mode
    Endif
    
    Last edited by ReneMiner; 15-11-2015 at 11:30.
    [TABLE="class: tblf1 tblf-fullwidth tblf-alternate"]
    [TR]
    [TD][COLOR=#b22222][B][SIZE=1]The limit is[/SIZE][/B][/COLOR][/TD]
    [TD="class: isRelinked"] [COLOR=#0000cd][B][SIZE=1]Imagination[/SIZE][/B][/COLOR][/TD]
    [/TR]
    [/TABLE]

  5. #5
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Philippines
    Age
    47
    Posts
    1,218
    Blog Entries
    1
    Rep Power
    132
    Please -
    it would be very useful and it's becoming more and more urgent for me to have thinAir being able to shell utilities on a current opened script.
    In words:

    I want to shell thinICE as a thinAir-utility from thinAir.
    thinAir shall pass the current active script (filename, fullpath)
    and wait in sync mode for thinICE to end, means no input into thinAir-codewindow possible for that time.

    thinICE can give the following results to thinAir:


    • no action

    - - - - - - - - - - - - - - - - - - - - - - - -

    • reload the current script
    • reload all in thinAir open scripts | to current script included ones that are opened

    - - - - - - - - - - - - - - - - - - - - - - - -

    • execute the current script [F5] after reload
    • debug current script [F8] after reload

    - - - - - - - - - - - - - - - - - - - - - - - -


    I still try to figure a way to shell helpfiles - only once per file and to close them when my script ends. Any ideas?
    Last edited by ReneMiner; 28-11-2015 at 13:53.
    [TABLE="class: tblf1 tblf-fullwidth tblf-alternate"]
    [TR]
    [TD][COLOR=#b22222][B][SIZE=1]The limit is[/SIZE][/B][/COLOR][/TD]
    [TD="class: isRelinked"] [COLOR=#0000cd][B][SIZE=1]Imagination[/SIZE][/B][/COLOR][/TD]
    [/TR]
    [/TABLE]

  6. #6
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Philippines
    Age
    47
    Posts
    1,218
    Blog Entries
    1
    Rep Power
    132
    I still hope for a way to integrate user-defined utilities to thinAir
    so even if thinAir is not open source written in thinBasic itself, every user can add features to run them on current open script-unit or on the main-script (where user can read out more included units of course)

    and to be able to return some orders to thinAir.

    We could achive that as thinBasic.exe does:
    user-utility has to place a result into some ini-file as for example
     OS_GetSpecialFolder(%CSIDL_LOCAL_APPDATA) & "temp\thinAir_Utility.Log"
    
    and if file exists thinAir will delete it and follow the order...

    like:
    [Reload]
    thinAir=1
    ;' no other orders possible then (= restart thinAir)
    
    ;' but if thinAir=0 then
    ;' can simply list filenames as
    File1=filename
    File2=...
    ;' to be reloaded by thinAir
    
    [Show]
    ;' thinAir shall display a certain scripts position:
    File=filename 
    Line=xxx 
    CursorPos=xxx
    ;' and/or we could already select text in codewindow:
    SelectionStart=xxx
    SelectionEnd=xxx | SelectionLen=xxx
    
    [Execute] 
    ;' thinAir shall execute a script (after possible reload) :
    File=filename
    Debug=1
    ;' if Debug then Run as F8, else as F5 was pressed
    
    Last edited by ReneMiner; 09-01-2016 at 11:12.
    [TABLE="class: tblf1 tblf-fullwidth tblf-alternate"]
    [TR]
    [TD][COLOR=#b22222][B][SIZE=1]The limit is[/SIZE][/B][/COLOR][/TD]
    [TD="class: isRelinked"] [COLOR=#0000cd][B][SIZE=1]Imagination[/SIZE][/B][/COLOR][/TD]
    [/TR]
    [/TABLE]

  7. #7
    Very interesting read thank you very much!

Similar Threads

  1. Should I make iPhone and iTouch Utilities?
    By gamegamer in forum Shout Box Area
    Replies: 14
    Last Post: 06-10-2010, 14:03
  2. LAN Utilities
    By gamegamer in forum User files and/or user projects
    Replies: 14
    Last Post: 23-08-2010, 21:33
  3. The 46 Best-ever Freeware Utilities
    By ErosOlmi in forum Software discussion
    Replies: 6
    Last Post: 08-03-2008, 10:27

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •