Jump to content

[Solved] Scripts opening in editor instead of running


Recommended Posts

So I just got a new computer, and instantly went and installed Autoit onto it. I selected run script as default action when clicking on an au3 file, however every time I do this it opens the script in the editor. I can from there run the script no problem.

I've tried reinstalling and checking the settings by hitting "Ctrl+1" and have confirmed it is set to run, but yet it just continues to open in the editor.

Any ideas why this is happening or how to solve?

New system is windows 10, old was windows 7

Edited by AnonymousX
Link to post
Share on other sites
  • Developers

This means you have changed the default as the AutoIt3 installer will use Run() as default.
Did you also install SciTE4AutoIt3?

If so: run SciTEConfig and select option Other tools/Run AutoIt3/SciTE check. The top part of the output will tell you whether you have still a standard install setting in the registry or if you have modified that. Can you post that information here so I can have a look?

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to post
Share on other sites

@Jos

 

All I did was go to:

https://www.autoitscript.com/site/autoit/downloads/

download Autoit and download the editor. It had checked off the default of run not open editor but still always opens it rather than runs.

For good measure I tried uninstalling and reinstalling one more time but got the same results.

 

******************************************************************************************************************************************
!*  Found always open with Win7    :Applications\SciTE.exe
!*  Fixed by removing Registry key : "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.au3\Userchoice"
* HKCR\.au3 Default       :AutoIt3Script
* HKCR\.au3 ShellNew      :C:\WINDOWS\SHELLNEW\Template.au3 (File Exists)
******************************************************************************************************************************************
* Explorer shell options:
* HKCR\AutoIt3Script\shell: 
*  => Default Action:Run
*     Compile                => Command:"C:\Program Files (x86)\AutoIt3\Aut2Exe\Aut2Exe.exe" /in "%l"
*     Compile with Options   => Command:"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /ShowGui /in "%l"
*     CompileX64             => Command:"C:\Program Files (x86)\AutoIt3\Aut2Exe\Aut2Exe_x64.exe" /in "%l"
*     CompileX86             => Command:"C:\Program Files (x86)\AutoIt3\Aut2Exe\Aut2Exe.exe" /in "%l"
*     Edit                   => Command:"C:\Program Files (x86)\AutoIt3\SciTE\SciTE.exe" "%1"
*     Open                   => Command:"C:\Program Files (x86)\AutoIt3\SciTE\SciTE.exe" "%1"
*     Run                    => Command:"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "%1" %*
*     RunX64                 => Command:"C:\Program Files (x86)\AutoIt3\AutoIt3_x64.exe" "%1" %*
*     RunX86                 => Command:"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "%1" %*
******************************************************************************************************************************************
* User SciTE info:
*    SCITE_USERHOME:C:\Users\anom\AppData\Local\AutoIt v3\SciTE: 
*    Directory missing: C:\Users\anom\AppData\Local\AutoIt v3\SciTE\SciTE Jump
*    SciTEUSer.Properties: 
*-----------------------------------------------------------------------------------------

import au3.UserUdfs
import au3.keywords.user.abbreviations
******************************************************************************************************************************************

 

Link to post
Share on other sites

@Jos

 

Okay so I went into the editor hit "ctrl+1" then tried switching it over to edit instead of run. Restarted computer. 

So then it said edit, switched it back to run, and restarted again and it seems to be working properly now!

I don't know why that happened but everything is good. 

Link to post
Share on other sites
  • Developers

As you can see in the output from SciTEConfig: There was a manual "Always Open with" done one time on this computer, so it will indeed give the issue you describe as swapping between Run/Open doesn't do anything when this is the case. The Output does suggest the fix as well and to remove the described registry key.

Jos 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to post
Share on other sites

@Jos

The issue came back so I'm guessing I need to do as you mentioned and removed the registry key. How is the best way to do this?

Run an Autoit script:

RegDelete("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.au3\Userchoice")

?

*edit* It didn't so much come back rather I fixed it for 1 particular file and noticed when opening a second file it was back to opening rather then running.

Edited by AnonymousX
Link to post
Share on other sites
  • Developers

You could simply open the regedit and do it manually. I didn't want to do it in the script but merely indicate what the issue is.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Professor_Bernd
      PSPad4AutoIt3 v2.0.0 beta (2021-04-16)
      All parts are freeware.

      PSPad4AutoIt3 consists of the Editor PSPad and the Improvement Kit, and can be used as an portable editor IDE for AutoIt3.

      The author of the PSPad Editor is Jan Fiala.
      I (Professor Bernd) am only the author of the Improvement Kit.

      Contact us:
      This is the first fully portable version of PSPad4AutoIt3.

      There are a lot of changes and new features, e.g.

      - a separate AutoIt3 menu in the PSPad main menu,
      - the shortcuts are SciTE-like,
      - Tidy for Au3,
      - in CallTipViewer a recognition for writing "(",
      - a dialog for registering file extensions with Pau3,
      - a nice about dialog in "90s style",
      - the CodeExplorer can now be displayed together with the FavTools on the right side,
      ( so the panel on the left side can be completely hidden )
      - and much more ...
      See here for details
      All in all a lot has been done and it is worth to have a look   Praise, criticism, ideas, tips and hints on bugs are welcome. Have fun with the new features!
      Thank you very much,
      Professor Bernd.
      Special thanks for the friendly support goes to:
      Jan Fiala (Author of PSPad)
      Jos van der Zande (Author of AutoIt3Wrapper, Tidy, ...)
      alpines (suggestions, ideas, testing, design for syntax colors, develop routines)
      argumentum (feedback, suggestions, ideas)
      AspirinJunkie (RegExp pattern, ideas and code snippets)
      Bitnugger (suggestions, ideas and code snippets)
      BugFix (suggestions, ideas and code snippets)
      Gun-Food (for making it possible to publish the project here)
      LarsJ (VBScript<->AutoIt communication, …)
      Musashi (suggestions and ideas)
      Credits for many other contributors can be found in the Pau3 About dialog.
      PSPad4AutoIt3 v2.1.0 beta - Update (2021-05-02) 
      See here for details v2.1.0 beta - Update
      Download in the german forum PSPad4AutoIt3 (Editor IDE), end of post #1   
    • By mLipok
      A new quick/small UDF.
      #include-once #include <AutoItConstants.au3> #include <MsgBoxConstants.au3> Global $RUN_WRAPPER_PID Global Enum _ $RUNWRAPPER_ERR_SUCCESS, _ $RUNWRAPPER_ERR_GENERAL, _ $RUNWRAPPER_ERR_COUNTER Global Enum _ $RUNWRAPPER_EXT_DEFAULT, _ $RUNWRAPPER_EXT_NOT_FINISHED_YET, _ $RUNWRAPPER_EXT_COUNTER If Not @Compiled And @ScriptName = 'Run_Wrapper.au3' Then _Example_for_Run_Wrapper() Func _Example_for_Run_Wrapper() _Run_Wrapper('ping 8.8.8.8') If @error then Return SetError(@error, @extended, 0) While $RUN_WRAPPER_PID Sleep(10) _Run_Wrapper_GetStdout() If @error Then _Run_Wrapper_GetStderr() If @error Then ExitLoop EndIf WEnd MsgBox($MB_OK + $MB_TOPMOST + $MB_ICONINFORMATION, 'Information #' & @ScriptLineNumber, _ _Run_Wrapper_GetStdout() & @CRLF & _ _Run_Wrapper_GetStderr() _ ) EndFunc ;==>_Example_for_Run_Wrapper Func _Run_Wrapper($sCommand) _Run_Wrapper_GetStdout(Null) _Run_Wrapper_GetStderr(Null) $RUN_WRAPPER_PID = Run(@ComSpec & " /c " & $sCommand, @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) If @error Then Return SetError($RUNWRAPPER_ERR_GENERAL, $RUNWRAPPER_EXT_DEFAULT, 0) Return $RUN_WRAPPER_PID EndFunc ;==>_Run_Wrapper Func _Run_Wrapper_GetStdout($v_Reset = Default) Local Static $s_StdOut = "" If IsKeyword($v_Reset) And $v_Reset = Null Then $s_StdOut = '' $s_StdOut &= StdoutRead($RUN_WRAPPER_PID) If @error Then Return SetError(@error, $RUNWRAPPER_EXT_DEFAULT, $s_StdOut) Return SetExtended($RUNWRAPPER_EXT_NOT_FINISHED_YET, $s_StdOut) EndFunc ;==>_Run_Wrapper_GetStdout Func _Run_Wrapper_GetStderr($v_Reset = Default) Local Static $s_StdErr = '' If IsKeyword($v_Reset) And $v_Reset = Null Then $s_StdErr = '' $s_StdErr &= StderrRead($RUN_WRAPPER_PID) If @error Then Return SetError(@error, $RUNWRAPPER_EXT_DEFAULT, $s_StdErr) Return SetExtended($RUNWRAPPER_EXT_NOT_FINISHED_YET, $s_StdErr) EndFunc ;==>_Run_Wrapper_GetStderr  
       
    • By Deshanur
      Am trying to automate injecting credential on the login form for all kind of Web application for IE. I know how to identify the form name by viewing the source code and using the method - _IEFormGetObjByName($ie, $form_Name).
      I would like to know how to identify or get the form object for the web app where there is no form name tag for example below, for the is I have used - _IEFormGetCollection($ie, 0) to get the form object.
      My Question is does it work for all kind of application "_IEFormGetCollection($ie, 0)" how to identify Index value? is it always 0? is there any better solution?
      The final solution am looking for is find out form object, get the username, password field and inject credential and submit the form.
      How to find out index value? for the forms which does not have form name field.
      $login_form = _IEFormGetCollection($ie, 0) $email_field = _IEFormElementGetObjByName($login_form, $form_UserName) $pass_field = _IEFormElementGetObjByName($login_form, $form_password) $login_button = _IEFormElementGetObjByName($login_form, $form_submitbutton) _IEFormElementSetValue($email_field, $CmdLine[2]) _IEFormElementSetValue($pass_field, $CmdLine[3]) ControlSend($hwnd, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]","{Enter}") OR This works fine if the form has form name. $login_form = _IEFormGetObjByName($ie, $form_Name) $email_field = _IEFormElementGetObjByName($login_form, $form_UserName) $pass_field = _IEFormElementGetObjByName($login_form, $form_password) $login_button = _IEFormElementGetObjByName($login_form, $form_submitbutton) _IEFormElementSetValue($email_field, $CmdLine[2]) _IEFormElementSetValue($pass_field, $CmdLine[3]) ControlSend($hwnd, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]","{Enter}")
    • By learner123
      Hi All,
      So I have created a small autoIT script to enter pin into a RSA token(app which generate new code every 30 second), and copy the generated code.
      I have a java application which requires this code so every time my java-code requires this RSA code, it runs the autoIT script and the copied generated code is then used in my java application. 
      I have deployed this code on a windows server and it works fine when I am logged in and the window is on focus, But as soon as I schedule task and disconnect the server (not logged out only disconnect), or even minimize the server window, the autoIT scripts fails and its not able to copy the value.
       
      Please find below the code for AUTOIT.
       
      WinActivate("rsa - RSA SecurID Token") ; activates the window that has old in the tilte bar
      WinWaitActive("rsa - RSA SecurID Token") ; waits until the window is the active window
      Send("1111") ; simulates pressing the Home key, enters password to get the code
      Send("{ENTER}") ; simulates pressing the Enter key
      Sleep(1000) ;
      Send("^c") ; simulates pressing the CTRL+c keys (copy)
       
      Also I saw some post regarding that WINACTIVE only works when window is active. But my below AUTO IT script to handle windows pop up  works perfectly fine when the server is disconnected. 
       
      Opt("WinTitleMatchMode", 1)
      WinWait("https://url","","10")
      WinWaitActive("https://url","","10")
      Sleep(2000)
      Send("userid")
      Sleep(1000)
      Send("{TAB}")
      Sleep(1000)
      Send("passwrd")
      Send("{TAB}")
      Sleep(500)
      Send("{ENTER}")
       
       
    • By WoodGrain
      Hi All,
      Trying to open windows explorer to a WebDav location and it's not working quite how I want, on the computers it is setup as a "network location" (as opposed to a "mapped drive", and this unfortunately can't be changed), the "Data" WebDav folder sits directly under "This PC" if that's an easier way to get to it. any suggestions as to what I can correct to get the 2nd example to work?
      ; This works, but I'm trying to avoid this as users normally see the URL style in the 2nd example below $folderToOpen = "\\mycompany.sharepoint.com@SSL\DavWWWRoot\Data" Run("Explorer.exe " & $folderToOpen) ; This does not work, it tries to open the WebDav url in the default web browser $folderToOpen = "https://mycompany.sharepoint.com/Data" Run("Explorer.exe " & $folderToOpen) ShellExecute also opens it in the default browser.
      Saw _WinAPI_ShellOpenFolderAndSelectItems but couldn't get the 2nd example to work.
      If I manually open Windows Explorer and paste in https://mycompany.sharepoint.com/Data it loads the WebDav directory without issue.
      If I have to use the pathing from the first example it is fine, just trying to give users a familiar experience.
      Thanks!
×
×
  • Create New...