Jump to content

Stumped on where script is going wrong ... creating 12 dummy text files per year ...


Go to solution Solved by Danyfirex,

Recommended Posts

Posted

I'm in the process of creating 4 years of calendars.  In another thread i received very kind help for the same type of thing for a different file creation process and it works flawlessly.  But here I've been coming back to the script over and over since last night, editing and changing, but I just can't figure out this time where it's going wrong.  Better eyes than mine have to see this 'cause I'm just not seeing it <lol>!

Here is the script with the 2 original lines in it from the other task that produce results as the first 2 lines:

#Region --- CodeWizard generated code Start ---
;InputBox features: Title=Yes, Prompt=Yes, Default Text=No, Input Length=4, Width=500, Height=125
If Not IsDeclared("sInputBoxAnswer") Then Local $sInputBoxAnswer
;$sInputBoxAnswer = InputBox("Year?","What year do you wish to create calendars for?",""," 4","500","125","250","250")
$sInputBoxAnswer = InputBox("Year?","What year do you wish to create calendars for?",""," 4","500","125")    ; width, height, left, top -- leaving out LEFT and TOP centers box.
Select
    Case @Error = 0 ;OK - The string returned is valid
        FileWrite(@ScriptDir & "\" & $sInputBoxAnswer & ".01 - JAN " & $sInputBoxAnswer & " - Wall Calendar .pdf",  "")  ; empty file -- THIS LINE WORKS
        FileWrite(@ScriptDir & "\" & $sInputBoxAnswer & ".02 - FEB " & $sInputBoxAnswer & " - Wall Calendar .pdf",  "")  ; empty file -- THIS LINE WORKS
        FileWrite(@ScriptDir & "\IC w-date (70perc)- " & $sInputBoxAnswer & ".01 - JAN " & $sInputBoxAnswer & " .txt,  ")  ; error:  INCORRECT # OF PARAMETERS IN FUNCTION CALL
        FileWrite(@ScriptDir & "\IC w-date (70perc)- " & $sInputBoxAnswer & ".02 - FEB " & $sInputBoxAnswer & " .txt,  ")  ; error:  INCORRECT # OF PARAMETERS IN FUNCTION CALL
    Case @Error = 1 ;The Cancel button was pushed
        Exit    ; finished
    Case @Error = 3 ;The InputBox failed to open
        Exit    ; finished
EndSelect
#EndRegion --- CodeWizard generated code End ---

Thank you!!!

  • Solution
Posted (edited)

this part 

& " .txt,  "

should be

& " .txt" ,

so you end up with

FileWrite(@ScriptDir & "\IC w-date (70perc)- " & $sInputBoxAnswer & ".01 - JAN " & $sInputBoxAnswer & " .txt","")

 

Saludos

Edited by Danyfirex
Posted

<lol>, I just _knew_ it was something my eyes were missing despite trying to fix it with a good sleep cycle in between tries! <lol>

This is great!  I just completed all the 3 calendar files for each month for 2026.  I'll do 2027 to 2030 later.  With these files in the folder, when I go to save the style sheet, the calendar file itself, and then the actual jpg of each month to use, it goes extremely fast and smoothly as I don't have to re-type each 3 times!!!  (12x3=36 files per year!).

Thank you!!!  :)

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
×
×
  • Create New...