AstronomerDaz

Odd error saving a file in Windows 10

4 posts in this topic

Having migrated my PC across to W10, I am getting an odd behaviour when executing a script that works perfectly under W7... Wondered if anyone else had come across this:

So, my script runs an external program called Deep Sky Planner. It opens two reports to calculate positions in the night sky for each of the 8 planets, plus the Moon and Sun. It then saves each of these reports as a HTML file, and a PDF file. I upload these to my astronomical societies web-site. One report is a set of basic data, then a more detailed one is run.

Each report is named with the month-year-object, so 1015Venus.html or 1015Sun_det.pdf

Under W7 (64bit), no problem. On my W10 machine, the change of the filename to be saved is not recognised by the 'Save As' dialogue box, even though the new file name is clearly there in the text edit box! So, I get an error saying that the file already exists!

I've attached a picture of the dialog box error so you can see what I mean.

I've also attached my code (feel free to rip this apart :) )

Has anyone else seen this? Any suggestions??

 

Thanks
Daz

dj_script_error.jpg

DSP_This_Month.au3

Share this post


Link to post
Share on other sites



AstronomerDaz,

I would check that you are actually deleting the files in the "; Clear out any files that may have been run already for this month" section as it appears from your image that there is indeed an exisitng file of that name still present.

M23

 


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

Share this post


Link to post
Share on other sites

Hi,

Yes, the files are being deleted - most definitely.

What the image is showing is:

1 The file 1115Sun.htm is NOT the name of the file being saved - The file being saved is 1115Mercury.htm. 1115Sun was saved on the first iteration of the loop

2. The background shows the console of the editor - where I print out the names of each report to be saved as a debug, so I can see the file name is being generated correctly

 

The filename 115Mercury.htm is being entered into the File Name box in the dialog, but the dialog box is not seeing it - it still thinks it is 1115Sun.html

 

 

Share this post


Link to post
Share on other sites

AstronomerDaz,

My apologies - I can only blame the small screen I was using earlier - and my old eyes!

Looking at this function (which appears to be the source of the problem)

Func ExportHTML (ByRef $object , $type)

   local $in=$savePath & $object, $out=""
   local $varSave

   $varSaveLabel=$varSaveHTMLLabel



   if $type = "B" then
   $in = $in & ".htm"
   Else
      $in = $in & "_det.htm"
   Endif

   send("!feh")
   WinWaitActive($varSave)
   Do
      ControlSetText($varSaveLabel, "" , "[ID:1001]", $in)
      Sleep(500)
      ControlSetText($varSaveLabel, "" , "[ID:1001]", "")
      Sleep(500)
      ControlSetText($varSaveLabel, "" , "[ID:1001]", $in)
      Sleep(500)
      $out=ControlGetText($varSaveLabel, "", "[ID:1001]")
      If $in<>$out Then
         ConsoleWrite("HTML path does not match - rewriting" & @CRLF)
         Exit
      EndIf

   Until $in=$out
   ControlClick($varSaveLabel, "", "[ID:1]")

EndFunc

I am struck by 2 things:

  1. You do not declare a value for $varSave and yet you use it in the WinWaitActive command.
  2. Are you sure the Control IDs you are using are the same in the Win10 dialog as they obviously were in Win 7?

Either of those might be causing a problem.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

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

    • Jos
      By Jos
      Merged the SciTE 3.7.3 source into our version and several other changes and fixes to the supporting utilities.
      Enjoy,
      Jos
      Addition/Changes/Fixes in the current installer:
      -------------------------------------------------------------------------------------------------- 24-2-2017 *** Merged the SciTE v 3.7.3 by Neil Hodgson with our own version of SciTE. (Jos) *** Updated AutoIt3Wrapper v17.224.935.0 (Jos)     - 16.612.1119.1 Fixed #AutoIt3Wrapper_Run_Stop_OnError=N, avoiding to stop even when No or not  specified.     - 16.612.1119.2 Fixed #AutoIt3Wrapper_Run_Stop_OnError=N, avoiding to stop even when No or not  specified.     - 16.612.1119.3 Added warning for #AutoIt3Wrapper_UseX64 in case #pragma(out,..)  is used. *** Updated Au3Stripper v17.224.935.0 (Jos)     - 16.612.1119.1 Fixed issue which sometimes was stripping a global const incorrectly     - 16.612.1119.2 Fixed /maxiterations parameter not recognised     - 16.612.1119.3 Fixed increased the max #Au3Stripper_Ignore_Variables to 500 and for #Au3Stripper_Ignore_Funcs to 200     - 16.612.1119.4 Fixed regression introduced in 16.612.1119.1 *** Updated SciTEConfig v17.224.935.0 (Jos)     - 16.306.1119.1 ... *** Updated Tidy v17.224.935.0 (Jos)     - 16.612.1119.1: Fixed Sort_Func function bug when the source contains a BOM. *** Updated CodewiZard v1.5.4.0 (Cyberyeye)     - Fix Icon Ressource Number for Messagebox Tab & ToolTip Tab     - Check/Fix missing includes using AutoIt3Wrapper_Add_Constants=y     - Added Opt("MustDeclareVars", 1) to fix undeclared variables     - Replaced msgbox() magic number by constant name     - Added GUISetIcon var (au3.ico)     - Removed unusefull old AutoIt3Wrapper directive *** Updated Abbreviations (mLipok)     - Updated au3abbrev.properties and helpfile page. --------------------------------------------------------------------------------------------------
      ==> ScitillaHistory page containing all SciTE-Scintilla updates.
      ==> Visit the SciTE4AutoIt3 Download page for the latest versions
      ==> Check  the online documentation for an overview of all extra's you get with this installer.
       
    • AnonymousX
      By AnonymousX
      Hello,
      I've been working on a program where a GUI with an input box and run button. User can enter in a 7 digit code and it will open up a file directory. The user can open up another GUI which enables them to save there own codes with an associated directory. This is done with a 2D array, where there is a column for the code, and a column for the file directory, there is also a column where user could enter in the path to a .exe file if they wanted to open a file instead of just the folder directory.
      Example of how the array could look:
      ;Savedcodes array columns[Codes][Address][EXE] #include <Array.au3> initiallist() Func initiallist();Initialization of array Global $savedcodes[1][2] ; Array for saving user entered commands $code = 0 $address = 1 ;Default codes $savedcodes[UBound($savedcodes)-1][$code] = "ggggggg";###Initialization### $savedcodes[UBound($savedcodes)-1][$address] = "G:\" _ArrayAdd($savedcodes, "") $savedcodes[UBound($savedcodes)-1][$code] = "ddddddd";###Initialization### $savedcodes[UBound($savedcodes)-1][$address] = "D:\" _ArrayAdd($savedcodes, "") $savedcodes[UBound($savedcodes)-1][$code] = "ccccccc";###Initialization### $savedcodes[UBound($savedcodes)-1][$address] = "C:\" _ArrayAdd($savedcodes, "") $savedcodes[UBound($savedcodes)-1][$code] = "hhhhhhh";###Initialization### $savedcodes[UBound($savedcodes)-1][$address] = "H:\" _ArrayDisplay($savedcodes) EndFunc Anyways everything runs pretty smoothly, however I am not sure how to save this array so that if the user was to close the program that they could use the codes they had entered in previously, without having to re-enter them in each time they open it. Any ideas on how best to achieve this?
      Users will not have administrative rights.
      The only way I can think of how to achieve this goal is by writing to the file, which I'd be totally happy doing. However I wouldn't know how to delete old lines that exist. I have a function already, that is able to read through a file and look for specific markers (say: ###Initialization###) and return that line number.  If the marker was detected I could delete that line, and then add new lines for every element of array using the _FileWriteToLine(). Any idea if there is a function instead of writing to a specific line it would delete it?
       
    • TheDcoder
      By TheDcoder
      Hello, I just noticed something strange... all of the "Tools" in SciTE's tools menu have disappeared!

      I am sure that I saw them yesterday... don't know what happened today ! I am using SciTE v3.6.6 which I believe is the latest version... Thanks in Advance!
    • algiuxas
      By algiuxas
      Hello,
      I'm having some problems with SciTe, when I copy and paste, select text, or etc., there's sometimes text blinking(not the cursor, but the whole text!), or black lines, they blink(like cursor do).

      When I reinstalled AutoIt all SciTe settings were left, and when I open up scite editor, I had same problem. (Btw., I use theme)

      How to fully uninstall AutoIT and SciTE, and install it again without leaving any settings or etc.?

       
      Solved: System restore helped me...
    • tcox8
      By tcox8
      Hello all,
      Long story short: I am updating a program I created many years ago for our Help Desk. I haven't used AutoIt in a while so I downloaded it again. Of course there were several script breaking changes so I opted to download an older version of AutoIt (3.3.8.1) which worked. However when downloading the full Scite it produces the attached error when trying to compile my script. I need the full version of Scite to compile with options. Is it possible to download older versions of Scite or is there an easy fix for this issue? I have attempted reinstalling, uninstalling/rebooting/reinstalling to no avail.
      Thanks!