dreivilo47

[Solved] Koda Form Preview does not work

17 posts in this topic

#1 ·  Posted (edited)

I have created a form in Koda.
When I want to see a form preview, I choose "Tools", "Run Form".
But in place of a form preview I see a file opened in Notepad (test.au3) with code.
What do I wrong?

Edited by dreivilo47
Problem solved

Share this post


Link to post
Share on other sites



#3 ·  Posted

9 minutes ago, Jos said:

You likely set the *.au3 file-extension to Run/Open with Notepad?

Jos

I don't know Jos.  Where can I check this in Windows 10?

Share this post


Link to post
Share on other sites

#4 ·  Posted

Just run this script in SciTE to show the current settings:

#include <WindowsConstants.au3>
#include <EditConstants.au3>
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=C:\Program Files (x86)\AutoIt3\Icons\au3.ico
#AutoIt3Wrapper_Add_Constants=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
;***********************************************************
; Scriptname: Get_AU3_Settings.au3
; Script to display Registry setting for SciTE & AutoIt3
; reporting possible issues with these settings
;***********************************************************
#include <StaticConstants.au3>
#include <GUIConstantsEx.au3>
_Check_Au3_Registry()
;
Func _Check_Au3_Registry()
    Local $TotalMsg,$UserData
    Display_Console("******************************************************************************************************************************************" & @CRLF, $TotalMsg)
    Local $FixedOpen = RegRead("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.au3", "Application")
    Local $FixedOpenW7 = RegRead("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.au3\Userchoice", "ProgId")
    If $FixedOpen <> "" Then
        Display_Console("!*  Found always open with         :" & $FixedOpen & @CRLF, $TotalMsg)
        Display_Console('!*  Fixed by removing Registry Hyve: "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.au3" Key:"Application"' & @CRLF, $TotalMsg)
    EndIf
    If $FixedOpenW7 <> "" Then
        Display_Console("!*  Found always open with Win7    :" & $FixedOpenW7 & @CRLF, $TotalMsg)
        Display_Console('!*  Fixed by removing Registry key : "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.au3\Userchoice"' & @CRLF, $TotalMsg)
    EndIf
    Local $au3prof = RegRead("HKCR\.au3", "")
    If $au3prof <> "AutoIt3Script" And $au3prof <> "AutoIt3ScriptBeta" Then
        Display_Console('!*  Registry key: "HKCR\.au3" - "Default" is currently set to ' & $au3prof, $TotalMsg)
        Display_Console('   ==> This should be changed to "AutoIt3Script" (or "AutoIt3ScriptBeta")' & @CRLF, $TotalMsg)
;~  RegWrite("HKCR\.au3","","REG_SZ","AutoIt3Script")
    Else
        Display_Console("* HKCR\.au3 Default       :" & $au3prof & @CRLF, $TotalMsg)
    EndIf
    Local $RegKeyBase = "HKCR\" & $au3prof & "\shell"
    Display_Console("* HKCR\.au3 ShellNew      :" & @WindowsDir & "\SHELLNEW\" & RegRead("HKCR\.au3\Shellnew", "Filename"), $TotalMsg)
    If FileExists(@WindowsDir & "\SHELLNEW\" & RegRead("HKCR\.au3\Shellnew", "Filename")) Then
        Display_Console(" (File Exists)" & @CRLF, $TotalMsg)
    Else
        Display_Console(" (*** File is Misssing!)" & @CRLF, $TotalMsg)
    EndIf
    Display_Console("******************************************************************************************************************************************" & @CRLF, $TotalMsg)
    Display_Console("* Explorer shell options:" & @CRLF, $TotalMsg)
    Display_Console("* " & $RegKeyBase & ": " & @CRLF, $TotalMsg)
    Display_Console("*  => Default Action:" & RegRead($RegKeyBase, "") & @CRLF, $TotalMsg)
    Local  $var, $var2
    For $i = 1 To 30
        $var = RegEnumKey($RegKeyBase, $i)
        If @error <> 0 Then ExitLoop
        Display_Console("*     " & StringLeft($var & "                       ", 22), $TotalMsg)
        $var2 = RegEnumKey($RegKeyBase & "\" & $var, 1)
        Display_Console(" => " & $var2, $TotalMsg)
        Display_Console(":" & RegRead($RegKeyBase & "\" & $var & "\" & $var2, "") & @CRLF, $TotalMsg)
    Next
    Display_Console("******************************************************************************************************************************************" & @CRLF, $TotalMsg)
    Display_Console("* User SciTE info:" & @CRLF, $TotalMsg)
    If EnvGet("SCITE_USERHOME") <> "" Then
        $UserData = EnvGet("SCITE_USERHOME")
        Display_Console("*    SCITE_USERHOME:" & $UserData & ": " & @CRLF, $TotalMsg)
    ElseIf EnvGet("SCITE_HOME") <> "" Then
        $UserData = EnvGet("SCITE_HOME")
        Display_Console("*    SCITE_HOME:" & $UserData & ": " & @CRLF, $TotalMsg)
    Else
        $UserData = @ScriptDir
        Display_Console("*    Portable:" & $UserData & ": " & @CRLF, $TotalMsg)
    EndIf
    If Not FileExists($UserData) Then
        Display_Console("*    Directory missing: " & $UserData, $TotalMsg)
    Else
        ; Check directory structure
        If Not FileExists($UserData & "\Au3Stripper") Then Display_Console("*    Directory missing: " & $UserData & "\Au3Stripper" & @CRLF, $TotalMsg)
        If Not FileExists($UserData & "\AutoIt3Wrapper") Then Display_Console("*    Directory missing: " & $UserData & "\AutoIt3Wrapper" & @CRLF, $TotalMsg)
        If Not FileExists($UserData & "\CodeWizard") Then Display_Console("*    Directory missing: " & $UserData & "\CodeWizard" & @CRLF, $TotalMsg)
        If Not FileExists($UserData & "\SciTE Jump") Then Display_Console("*    Directory missing: " & $UserData & "\SciTE Jump" & @CRLF, $TotalMsg)
        If Not FileExists($UserData & "\SciTEConfig") Then Display_Console("*    Directory missing: " & $UserData & "\SciTEConfig" & @CRLF, $TotalMsg)
        If Not FileExists($UserData & "\Tidy") Then Display_Console("*    Directory missing: " & $UserData & "\Tidy" & @CRLF, $TotalMsg)
        ; check key files
        If Not FileExists($UserData & "\abbrev.properties") Then
            Display_Console("*    File missing: " & $UserData & "\Aabbrev.properties" & @CRLF, $TotalMsg)
        Else
            If Not FileGetSize($UserData & "\abbrev.properties") Then Display_Console("*    File empty: " & $UserData & "\Abbrev.properties" & @CRLF, $TotalMsg)
        EndIf
        If Not FileExists($UserData & "\au3abbrev.properties") Then
            Display_Console("*    File missing: " & $UserData & "\au3abbrev.properties" & @CRLF, $TotalMsg)
        Else
            If Not FileGetSize($UserData & "\au3abbrev.properties") Then Display_Console("*    File empty: " & $UserData & "\au3abbrev.properties" & @CRLF, $TotalMsg)
        EndIf
        If Not FileExists($UserData & "\SciTEUSer.properties") Then
            Display_Console("*    No SciTEUSer.properties yet" & @CRLF, $TotalMsg)
        Else
            Display_Console("*    SciTEUSer.Properties: " & @CRLF, $TotalMsg)
            Display_Console("*-----------------------------------------------------------------------------------------" & @CRLF, $TotalMsg)
            Display_Console(FileRead($UserData & "\SciTEUSer.properties") & @CRLF, $TotalMsg)
        EndIf
    EndIf
    Display_Console("******************************************************************************************************************************************" & @CRLF, $TotalMsg)
    ClipPut($TotalMsg)
    GUICreate(".au3 registry settings", 1000, 600)
    GUICtrlCreateEdit($TotalMsg, 1, 1, 998, 560,$ES_READONLY+$WS_VSCROLL+$ES_AUTOVSCROLL)
    GUICtrlSetFont(-1, Default, Default, Default, "Courier New")
    Local $HReg_Exit = GUICtrlCreateButton("Exit", 450, 570, 50, 25)
    GUICtrlCreateLabel("* information is stored on the clipboard.", 10, 575)
    GUISetState(@SW_SHOW)
    Do
        $msg = GUIGetMsg()
    Until $msg = $GUI_EVENT_CLOSE Or $msg = $HReg_Exit
    GUIDelete()
EndFunc   ;==>_Check_Au3_Registry
;
Func Display_Console($msg, ByRef $TotalMsg)
;~  ConsoleWrite($msg)
    $TotalMsg &= $msg
EndFunc   ;==>Display_Console

Jos :)

1 person likes this

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#5 ·  Posted

Thank you for the script.

Share this post


Link to post
Share on other sites

#6 ·  Posted

My current settings:

1.jpg

Share this post


Link to post
Share on other sites

#7 ·  Posted

As you can see you have done a right-mouse-click on an au3 file and selected always open with notepad. 

There is a hint in that output how it can be fixed. ;)

Jos

1 person likes this

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#8 ·  Posted

Thank you for the info Jos.
I've removed the registry key "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.au3\UserChoice".
But the form preview doesn't open.

Share this post


Link to post
Share on other sites

#10 ·  Posted

This is now the output of the earlier script:

2.jpg

Share this post


Link to post
Share on other sites

#11 ·  Posted

I've changed "au3_auto_file" to "AutoIt3Script" at registry key "HKEY_CLASSES_ROOT\.au3" (Default).
But the form preview doesn't open.  It opens a new AU3-file with code in SciTE!

Share this post


Link to post
Share on other sites

#12 ·  Posted

No response from Jos.
I suppose opening a new AU3-file with code in SciTE is a form preview.
If so, my problem is solved.
Thanks for your help Jos.

Share this post


Link to post
Share on other sites

#13 ·  Posted

I can only assume that Koda is using the standard "Open" action for .au3, so when that is set to "SciTE" then that is what you will see. ( and also what I see)
Changing this to Run (open with AutoIt3.exe) will likely show what you want to achieve.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

mmm ... I see that Koda also has an option to set it manually to AutoIt3.exe when you want .....  so you didn't browse all options and tried them?

That actually works pretty well and took a whole 5 minutes to figure out. ;)

Jos

Edited by Jos
1 person likes this

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#15 ·  Posted

No, I didn't browsed all options.  I'm sorry for this.
I have set it manually to AutoIt3.exe.  It shows now what I want to achieve.
Thank you very much Jos!

Share this post


Link to post
Share on other sites

#16 ·  Posted

You're welcome ... and my last post was merely a tongue-in-cheek remark... also towards myself not checking earlier. :)

Jos

1 person likes this

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#17 ·  Posted

On 15-8-2017 at 6:25 PM, Jos said:

You're welcome ... and my last post was merely a tongue-in-cheek remark... also towards myself not checking earlier. :)

Jos

:)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Similar Content

    • dascondor
      By dascondor
      I  need to has Opt(GUISetOnEvent,-1) available in my script, but since I'm using koda designer it uses GUIgetmessage is there any work around for this. I'm pretty new to this stuff so any help is great appreciated.
      Any Thoughts?
       
    • TheSaint
      By TheSaint
      As many of you may not be aware, of much about AutoIt's humble beginnings, and aspects related to the first GUI version of AutoIt, I thought it might be nice to create a historical reference here for all the many GUI creators that have been created by various people over the years.
      NOTE - While one could argue, that this topic might be better placed in one of the Chat forums, I would argue, that it links to heaps of good code. While much may be redundant in that code, it is still interesting and forms a great perspective. Many are bound to find useful elements at the very least.
      Koda, is no doubt the most well-known GUI creator now, but there was a time, when CyberSlug's legendary GUIBuilder (first known as AutoBuilder) ruled the roost, and AutoIt coder's saw it as a Godsend. AutoIt coding was much simpler back then of course.
      Below, will be a timeline, of any AutoIt GUI creators listed in forum pages. It will be added to by myself as I find them or as others here find them and place a link in a subsequent post ... PLEASE HELP! Comments welcome too.
      (Also note, that this is also intended to include updates, branches etc by others)
      Apr 20 2004 - AutoBuilder by CyberSlug.
      Sep 27 2004 - An interesting topic, where CyberSlug talks about the future of AutoBuilder (etc) and renaming to GUIBuilder and you see the first mentions and links to updates by others (including myself & livewire).
      Nov 05 2004 - A topic where lookfar is working on a SciTE replacement, talks about starting a Form Designer.
      Aug 10 2005 - GuiBuilder first update by TheSaint.
      Sep 26 2005 - GUIBuilder updates by livewire (he also talks about transferring his efforts to Koda).
      Nov 02 2005 - KODA FormDesigner v1.3 by lookfar
      Nov 03 2005 - Seemingly interesting topic about forms by tonedeaf
      Dec 26 2005 - AutoIt Studio(beta) by BillLuvsU
      Jan 09 2006 - AutoBuilder update (or branch) by _^__darkbytez (livewire also posts).
      Feb 19 2006 - Koda v1.5 by lookfar
      Sep 07 2006 - Koda v1.7.3.0 by Lazycat
      Jan 07 2007 - Form/GUI Builder by FlintBrenick
      Jun 10 2007 - Gorganizer by _Kurt (more of an assister than actual GUI maker)
      Jun 27 2007 - Basic GUI Designer by Mast3rpyr0
      May 03 2008 - Autoit Programmer's Desktop (APD) by Ealric
      Jul 11 2008 - Gui Designer by Alek
      Aug 11 2008 - Gorganizer update by _Kurt
      Jun 19 2009 - Easy GUI by Mat
      Aug 13 2009 - GUI Script Creator by Pandemic (not sure this qualifies, but it made me think of templates)
      Aug 16 2010 - Creation Gui by AZJIO
      Jan 22 2012 - ISN AutoIt Studio by ISI360 (includes ISN Form Studio 2, a GUI editor)
      Mar 19 2012 - Arduino GUI Programmer by nikosliapis (creates a specific type of GUI)
      Aug 01 2012 - GuiBuilder Resurrected update/branch to GUIBuilder by baroquebob
      Dec 01 2012 - Form Builder beta (v1.0.6) by BuckMaster
      Jan 12 2015 - GUIBuilderNxt update by jaberwacky of GUIBuilder v0.8 (as a new prototype, modified to work with latest AutoIt) (not a update to the Resurrected version)
      Aug 12 2016 - The GuiBuilder Return by DFerrato as an update to GUIBuilder,
      Jan 17 2017 - GUIBuilder Project by TheSaint (a work in progress based on CyberSlug's original ... and later versions, updated by Roy, TheSaint & others).
      There are a significant number of creators/designers that have been started and never completed.
      +++++ STILL UNDER CONSTRUCTION +++++
      P.S. Well that's it from me tonight. I know of at least one other major creator, but cannot recall it's name or the name of the coder, though I think it starts with 'L'. Bound to be a few I've missed, and some I cannot seem to find their first appearance here (Koda, Form Builder, etc), but there may be an obvious reason for that. Will probably rely on feedback from others now that I've got the ball rolling.
      NOTE - If anyone wants to discuss any of these programs above or give some background history, then by all means do so. I will cross-reference (link to) any important comments.
    • Masum
      By Masum
      Hi all,
      Can the default Koda icon for forms be changed? If so, how?
      Thanks
    • Morthawt
      By Morthawt
      I have a program I made long ago for something but I never saved the koda file so it would make it a complete pain for me to visually tweak anything because as far as I am aware, I would have to design an entirely new GUI.
      Would it be possible for you guys at AutoIt to add functionality to Koda so that you can take an existing GUI section, with while loop and cases and all and then koda would literally build it ready for tweaking and where existing things still exist and have been tweaked, it would tweak such details and keep all the existing case information and added formatting things that were manually tweaked etc?
      This would be really amazing and I feel that other people would benefit from it. I can't be the only person who makes a GUI, doesn't save it and then has no problems making minor tweaks in-code but struggles like hell to go rearranging things perfectly. That is where using a GUI (koda) to make and arrange a GUI you are making, makes everything easy and pleasure to deal with.
      tldr;
      Example:
      A friend gives me his code and wants help. The GUI is just a mess, but trying to do all the alignment and positioning all by digits in code would be a pain. I cannot just hallucinate where everything is based on pixel locations and sizes. So I would take the entire GUI chunk of code, all the form/controls/formatting functions/while loop/switch/case in it's entirety and paste it into an area of Koda and press a button. Koda would then build the GUI on the screen, placing all the controls and formatting them with the instructions that may have been added and keeps the case information as-is. Then when you make your alterations in Koda, you go to export it and it makes an entirely new export that re-makes (from scratch as if you had made this GUI from scratch) all the code for controls, size, placement etc and then also adds all the existing case code back as part of the code you then send (or manually copy/paste as I do) to Scite editor.
      Is there any chance this could be implemented? I think this could help a lot of people with their own scripts and others'.
    • The_Key_Maker
      By The_Key_Maker
      Hi guys, 
      I have the latest Scite installed (SciTE4AutoIt3 3.6.2 - Feb 15 2016 18:42:26), running on Windows 7.
      I tried running Scite in parallel to AutoIT, with running manually in the command line "C:\Program Files (x86)\AutoIt3\SciTE\Koda\FD.exe" /Scite,
      It didn't work, and ever since, I can't activate Koda from the AutoIT Tools menu. 
      I get the same error (only by trying to open Koda): %1 is not a valid Win32 application.
       
      Can someone please help me?