How to change name?

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
jj45410
Junior Coder
Posts: 38
Joined: Tue Nov 18, 2008 8:14 pm

How to change name?

Post by jj45410 » Sat Mar 28, 2009 2:06 pm

Hi, I just made a filepath checker.. Just incase when a script isn't working I can quickly check the file path.. or whatever. Anyway when the program is launched it says Macro scheduler input as the name at the top. How do I change the name?

Code looks like this



Code: Select all

Input>test,Enter Filepath
IfDirExists>test
messagemodal>Filepath is correct
else
messagemodal>Filepath is invalid
endif
also if I dont put a file path in and just close the program it says filepath invalid of course. is there a way to make that message not appear at all if im just closing it, say I opened it by accident.
[/code]

User avatar
JRL
Automation Wizard
Posts: 3518
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Sun Mar 29, 2009 12:17 am

How do I change the name?
You can change the name if you really want to. Search Scripts and Tips and you'll find a technique. However, its much easier to use a dialog.
is there a way to make that message not appear at all if im just closing it, say I opened it by accident.
When you do use an input and you want to close the program when there is no input, test teh variable for null condition then exit from the script. For example:

If>test=
Exit>0
EndIf


Here's my version of your script using a dialog.

Code: Select all

Dialog>Dialog1
   //Make the caption what you want to see in the window title
   Caption=Does Path\File exist?
   Width=561
   Height=130
   Top=CENTER
   Left=CENTER
   Label= ,32,48
   Edit=msEdit1,32,25,489,
   Button=Check,237,76,75,25,3
   Label=Path and file to be checked,32,8
EndDialog>Dialog1

Show>Dialog1

SRT>CheckFile
  IfDirExists>dialog1.msedit1
    Let>Dialog1.mslabel1=Filepath is correct
  else
    Let>Dialog1.mslabel1=Filepath is invalid
  endif
  ResetDialogAction>Dialog1
END>CheckFile

Label>Loop
GetDialogAction>Dialog1,res1
If>res1=2
  Exit>
EndIf
If>res1=3
  GoSub>CheckFile
EndIf
Wait>0.01
Goto>Loop

ainterne
Junior Coder
Posts: 29
Joined: Tue Jun 05, 2007 4:03 am

Post by ainterne » Tue Apr 07, 2009 6:02 pm

Just for refrence you could do this just so you know how, but the previous suggesting leaves you more contol on how to deal with data entry.

Code: Select all

Input>test,Enter Filepath
IfDirExists>test,True,False
Label>True
Message>Filepath is correct
Goto>End
Label>False
If>test=
goto>End
else
Message>Filepath is not correct.
Endif
Label>End
Phil.......

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts