AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Random Desktop Background

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
newoob
Guest





PostPosted: Fri Mar 19, 2010 7:10 am    Post subject: Random Desktop Background Reply with quote

Hi everyone,

I need help in making my script, i need some codes to make my script select a random file inside a folder every time the script is executed, i already had my script for changing the background, i just need to select a random file. Any help would be appreciated. Thanks.

P.S.
I don't want to rename the filenames of my wallpapers.
Back to top
MasterFocus



Joined: 08 Apr 2009
Posts: 3035
Location: Rio de Janeiro - RJ - Brasil

PostPosted: Fri Mar 19, 2010 7:28 am    Post subject: Reply with quote

1) Loop the files
2) Inside the Loop, store the number of files (use A_Index)
3) Use the Random command to get a number between 1 and the number of files
4) Loop the files once again
5) This time, if A_Index is the same as your randomized number, change the background
_________________
"Read the manual. Read it again. Search the forum.
Try something before asking. Show what you've tried.
"

Antonio França
My stuff: Google Profile
Back to top
View user's profile Send private message Visit poster's website
newoob
Guest





PostPosted: Fri Mar 19, 2010 8:13 am    Post subject: Reply with quote

Many thanks.
Back to top
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group