Sign in to follow this  
Followers 0

newbie q2 - how to use a macro?! another quick q..

3 posts in this topic

OK this should be another quick question for someone to bat away...

I'm trying to copy some files from the Desktop, to another location.

So I reckon the FileCopy will probably do what I want.

FileCopy ("source","G:\Backups\Desktop\*.*",1)

My question is, how do I use the @DesktopDir macro be in the source parameter?

I can think of a long winded way to do it, which will probably work - but for practice I'd like to know if I can do something like this...

FileCopy (@DesktopDir"\*.txt","G:\Backups\Desktop\*.*",1)

Will that work?

Do I need an & or something between the macro and the rest of the source parameter for it to concatenate the two?

Is it possible to use the macros in that manner?

The long-winded way I thought of was by setting a global to the value of @DesktopDir, then appending the string "\*.txt" to the end of the global.

Then using the global in place of the "text path".

Though if it is possible using the method I've put in code above, then I'd like to know the correct syntax.

Many many thanks.

I'll get used to this new version of AutoIt sooner or later!

Share this post

Link to post
Share on other sites

see my icon?

you're right about needing the &

FileCopy (@DesktopDir & "\*.txt","G:\Backups\Desktop\*.*",1)

"I'm not even supposed to be here today!" -Dante (Hicks)

Share this post

Link to post
Share on other sites

Thanks for that - I thought it would be something like that.

Trust me I've been using the documentation.

I just couldn't find any examples to show me exactly what to do.


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
Sign in to follow this  
Followers 0