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

    • wakillon
      By wakillon
      SciTE Hopper : Jump to Any line by one click and many other helpfull functions !


      As Ashalshaikh suggested me after leaving me the task to continue >SciTE Hopper, i open a new Topic about it.
      It will be more easy for futures updates.

      Many helpfull functions in contextual menu.
      SciTE Hopper is now multipurpose.
      • Color Catcher added
      • BinaryToAu3Kompressor added
      • TinyAu3Search replaced by StringFinder
      • RegJumper added
      • Edit With SciTE added (available in Options)
      • SpecialCharactersViewer added (available in Tray menu)
      New Contextual Menu :

      For a right Click on a function :

      • Copy function name
      • Insert a function header
      • Cut function
      • Copy function
      • Delete function
      • Create a variables List
      • Remove usseless Blank lines
      • Remove Debug lines ( all lines starting with ConsoleWrite or _ArrayDisplay )
      • Set AutoIt Code Layout
      • Remove Comments

      For entire script :

      • Create a functions List
      • Create a variables List
      • Remove usseless Blank lines
      • Remove Debug lines ( all lines starting with ConsoleWrite or _ArrayDisplay )
      • Set AutoIt Code Layout
      • Remove Comments
      • ( Open in SciTE a ) Duplicate of current Script in Temp Dir
      • ( Open in SciTE a ) Duplicate of current Script in Same Dir
      • Explore Parent Script Folder
      • Copy Script name
      • Copy Script path
      • Find Unused Functions
      • Find Unused Variables
      • Set all functions in alphabetic order.( func headers and regions ( in fact, all lines between functions ) are not supported.)

      SciTE Editor New Contextual Menu if SciTE Hopper is added ( in Options ) to SciTE Editor :
      when you made a selection in SciTE Editor you can :

      • Open a Reg Key in Regedit using RegJumper
      • Open a Url in your default Browser
      • Search on google in your default Browser
      • Search on AutoIt Website in your default Browser
      Now Can be added to windows start (minimized)
      Options are available by Tray Menu.
      A double click on tray icon will open clipboard content to SciTE Editor ( Handy when you have copied some code from your browser )

      How to proceed for add SciTE Hopper to SciTE Editor :
      Run Scite Editor, run Scite Hopper ( compiled! ) go to Options and select Add/Remove to SciTE Tab. then click on Add button and it's done !
      Right click on SciTE Editor and choose SciTE Hopper in Contextual Menu for run it when you need it !
      Update of 07 Dec 2017
      TinyAu3Search is replaced by StringFinder

      Previous downloads : 1287
      Script and compiled version are available in the download section
       
      Thanks to Ashalshaikh, Melba23, Th3 MMA, Alzri2, taitel, Manadar, taz742, Yashield, Authenticity, Xenobiologist for their help
      and asdf8 for his >Includes Helper and azjio for his >FileSearch.

      Hope it help you and happy Scripting !

       
    • wakillon
      By wakillon
      For more details go to the Topic
    • JaredStroeb
      By JaredStroeb
      I need to open an application and send it keys in Session 0.  I have exe's working locally, I can see the application open in session 0 through interactive services, but my send commands do not go to the application.  The following article running-autoit-session-0, directs me to use ControlSend() however my application has no controls that can be identified by AutoIt v3 Window Info.  Get All Windows Controls also returned nothing for the application's handle.  
      What are my options?  
      Can this be done with AutoIt?
      Is there a different "relatively simple" library/tool to use? (I am familiar with C# if there is a viable library there )

       
    • Skysnake
      By Skysnake
      Scite comes up occasional, almost incidentally, in some support topics.  I have not found a "Scite" topic in the forums, so this is where I will start.  I have recently been using Scite intensively, specifically with a large project and I have certain issues.  I know that Scite is not an AutoIt product, but it is so closely integrated to the core release that it makes sense to raise issues and request support here.  If this is not the right please refer me to the right forum.
      Thx
       
      Skysnake
    • TrashBoat
      By TrashBoat
      I've messed around in scite theme settings and it left this blue bar , how can i get rid of it?
      Image (imgur)