CreateDir

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

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

CreateDir

Post by jj45410 » Mon Dec 01, 2008 9:44 am

Ok, A test script I was playing with and is now fixed uses createdir, How do I tell it where to create the directory? because it just creates it in my Macro scheduler folder.. I wish it to appear on my desktop.
Thank you, jj45410

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Dec 01, 2008 10:14 am

CreateDir>%DESKTOP_DIR%\new_folder
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

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

Post by jj45410 » Mon Dec 01, 2008 11:10 am

Thank you, Works fine now

User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Mon Dec 01, 2008 6:28 pm

Hey Marcus,
DESKTOP_DIR is not documented in the help file. Maybe this can be added to version 11?

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Dec 01, 2008 6:44 pm

Didn't realise it wasn't documented. I'll get it added.

But does no one use the debugger? Step through any script and you'll see it in the watch list.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Mon Dec 01, 2008 6:59 pm

Thanks.

I don't use the debugger all that much but when I do I don't use the watch list. I always find where I screwed up by looking at the script.

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Dec 01, 2008 7:02 pm

Rain wrote:I don't use the debugger all that much but when I do I don't use the watch list. I always find where I screwed up by looking at the script.
Wow. I can't imagine how I could get by without the watch list. It amazes me that some people don't use it.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Dec 01, 2008 7:04 pm

BTW - your sig thinks I'm using Windows ME. I'm not, I'm using Vista. Might want to update the script.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

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

Post by JRL » Mon Dec 01, 2008 7:16 pm

Rain wrote:
I don't use the debugger all that much but when I do I don't use the watch list. I always find where I screwed up by looking at the script.


Wow. I can't imagine how I could get by without the watch list. It amazes me that some people don't use it.
I agree with Marcus, the watch list is the primary tool for me when debugging a script. It makes things soooo much easier. Most of the time that I help someone on the forum I find their error by simply stepping through their script and observing the watch list. (At least on those occasions when someone actually submits a script to test)

User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Mon Dec 01, 2008 7:24 pm

mtettmar wrote:BTW - your sig thinks I'm using Windows ME. I'm not, I'm using Vista. Might want to update the script.
Surprise Surprise, must not like Vista like many programs out there.
Thanks for letting me know.

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Mon Dec 01, 2008 7:24 pm

mtettmar wrote:But does no one use the debugger? Step through any script and you'll see it in the watch list.
Thanks for that tip Marcus, I didn't think to use the debugger for that - I just did and amongst others, I found all these system variables that appear to hold directory values:

CWD=
DESKTOP_DIR=
SCRIPT_DIR=
SCRIPT_FILE=
SYS_DIR=
TEMP_DIR=
USERDOCUMENTS_DIR=
WIN_DIR=

On searching the Help File (in MS ver 10.1.21) I see that USERDOCUMENTS_DIR isn't documented either... please add as well.

I notice that the "System Variables" page in the Help File contains a great many values, far more than the ones shown in the debugger. I take it this is because variables (including system variabbles) in MS are not created until they are needed... and the ones showing up in the debugger when things first initialize are the bare minimum ones that are ALWAYS created... is that true?

The following things might be nice to add to the Help File "System Variables" page:

- Tip: Use the Debugger Watch List to see which System Variables exist and their values.

- Tip: Only certain System Variables are instantiated when a scripts runs, again check the Debugger Watch List. (or these could be flagged somehow in the Help File, colored, bolded, *'d, etc.)

- Tip: Be careful not to create a variable with the same name as a System Variable as it may produce unintended side-effects.

(I believe your new ver 11 editor now gives system variables a unique color - that should help peole not to create/use them by mistake).

- Tip: Capitalization in variables does not matter... cmd = Cmd = CMD i.e. they all refer to the same variable and in this case, its a System Variable.

Just some thoughts... take care.
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Dec 01, 2008 7:30 pm

Some variables need to be created on script start, and others don't need to be created until they are used/set by the user.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Mon Dec 01, 2008 7:58 pm

What's funny is that I have been using a VB script all this time to locate the current users desktop directory. I could have compiled smaller exe's if I would have known about this variable :?

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Mon Dec 01, 2008 10:26 pm

Rain wrote:What's funny is that I have been using a VB script all this time to locate the current users desktop directory. I could have compiled smaller exe's if I would have known about this variable :?
Yes... it shows the importance of documentation... in this case... the Help File. I've been bitten before too as I tend to think that if its not in the Help File, it doesn't exist but that's not always the case.

Three cheers for these forums and mjtnet's efforts at continually improving not only the software... but the documentation as well.
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Tue Dec 02, 2008 9:08 pm

Hi All,

I just upgraded to the newly released Macro Scheduler version 11.

I see the following two entires have been added to the Help File in the "System Variables" topic/page:
  • DESKTOP_DIR User's Desktop Path

    USERDOCUMENTS_DIR User's Documents Path
Thanks Marcus
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

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