Please help!

General Macro Scheduler discussion

Moderators: JRL, Dorian (MJT support)

Post Reply
Dimmak
Junior Coder
Posts: 25
Joined: Tue Jan 24, 2012 4:57 pm

Please help!

Post by Dimmak » Fri Feb 10, 2012 12:01 pm

How can i get folder path like that:
{0302F4E8-70D2-4C4D-B74C-ED88F9E5AD89}
:?:

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

Post by Marcus Tettmar » Fri Feb 10, 2012 1:24 pm

This is a GUID.

Can you define "get"? Do you mean you want to MAKE one? Or you want to retrieve one from somewhere? If the latter, where from, what are you trying to "get"?

If you want to make one:

Code: Select all

VBSTART
Function MakeGuid
  Set TypeLib = CreateObject("Scriptlet.TypeLib")
  MakeGuid = TypeLib.Guid
End Function
VBEND

VBEval>MakeGuid,myGuid
MessageModal>myGuid
If you mean something else please clarify.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

Dimmak
Junior Coder
Posts: 25
Joined: Tue Jan 24, 2012 4:57 pm

Post by Dimmak » Fri Feb 10, 2012 2:37 pm

For example:
Here is folder: C:\temp\1
I need it's path in format like this:
{799C96C4-0145-4EFA-9C13-C0C6955B0210}

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

Post by Marcus Tettmar » Fri Feb 10, 2012 3:38 pm

Well you can get a list of subfolders with GetFileList. Then loop through.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

Dimmak
Junior Coder
Posts: 25
Joined: Tue Jan 24, 2012 4:57 pm

Post by Dimmak » Fri Feb 10, 2012 5:38 pm

Marcus!
I don't know how to put variable into VB function.

Code: Select all

Let>path=C:\fldr
VBSTART
Function MakeGuid
  Set TypeLib = CreateObject("Scriptlet.TypeLib")
  MakeGuid = TypeLib.Guid
End Function
VBEND

VBEval>MakeGuid,myGuid
MessageModal>myGuid
So, please
How to put %path% into YOUR VB function??

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

Post by Marcus Tettmar » Mon Feb 13, 2012 2:34 pm

What do you want the function to DO with your path variable?

Here's how to pass a parm to a VBScript function:

Code: Select all

VBSTART
Function MyFunc(var)
  MsgBox var
  'etc
End Function
VBEND

Let>path=c:\folder
VBEval>MyFunc("%path%"),res
All this will do is display the value in a message box, but you can see how it is passed in.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

Dimmak
Junior Coder
Posts: 25
Joined: Tue Jan 24, 2012 4:57 pm

Post by Dimmak » Tue Feb 21, 2012 4:59 pm

Thanks, Marcus!
That's it! :D

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