Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

How should i do things liek this?

  1. Aug 16, 2007 #1
    IM looking for a way to write programs, or maybe "script" is abetter word, to perform certain "chores" on my computer.

    Let me give you a few examples.

    My desktop is constantly cluttered with random ****.
    Video files, text files, music files, html documents, etc ...

    I want to write a program that when i execute it, it goes through my desktop, and puts all the files into certain folders i indicate.

    And also, i want to organize many text files. Like, for school related ****, lets say i tag them with something liek "sr" which stands for school related.

    So i change the file name of lets say "history essay.rtf" to "sr history essay.rtf" so when i run the program it puts tagged documents like that into a separate folder for school related stuff.

    Another thing is, ts annoying for me to check my emails. I would like to write another program, so when i execute it, it goes into my email, copies the first 5 email messages and the sender, and pastes it into a text document, so instead of checking my email, i can simply execute a program and read emails in a text document.

    Also, in relation to email ****, i would like to make another program that when i execute it, it reads a textfile containing email addresses, subject lines, and the actual message (which i would write myself), and sends the email off without me ever ahving to log into my email.

    also, when i say "run" the programs, i want it to be so when i click it, one of those black command boxes comes up (liek when you open .bat things) just quit right after its done. So everything i want is done with one double click.

    so, my question is, how would i go about making these types of programs or scripts or whatever the word is. im not asking anyone to write these for me, just what would be the best languages to use.

    I took computer programming 4 years ago in highschool, and i was exposed to visual basic.

  2. jcsd
  3. Aug 16, 2007 #2


    User Avatar

    Staff: Mentor

    Tcl ("tickle") is a common scripting language. I've used it for production-level manufacturing test programs in the past. The learning curve is not bad, and there are lots of web resources to help out:

    Free Download: http://tcl.activestate.com/software/tcltk/downloadnow83.html

    Wiki for help: http://wiki.tcl.tk/

    Others like Python better than Tcl (chroot especially). A quick google search should get you to Python download and help sites.

    Have fun!
  4. Aug 16, 2007 #3


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    I don't even want to imagine how painful it would be write a web-browser or POP3 component in TCL. In fact, I wouldn't even bother trying.

    In Python, you should be able to get a web-based email client running in a couple dozen lines using the mechanize module, or a POP3 client running in a couple dozen lines with the poplib module.

    - Warren
  5. Aug 17, 2007 #4
    how about doing this in something like c++ or visual basic?
    Cause i can get an educational copy of visual studio.net for 10 dollars at my highschool.
  6. Aug 17, 2007 #5


    User Avatar
    Science Advisor

    Much of these tasks are simple enough that you're better off using simple VBScript, run through the Windows Scripting Host (if you're running Windows).

    For example, create a file test.vbs with the following contents:
    Code (Text):

    MsgBox "Hello World"
    And double-click to run (no compiling required)...
    There are plenty of samples on the web since VBS is used commonly by Network Admins for automation and logon scripts, etc.
    Here's one for moving files:

    You can also use batch files for simpler tasks such as delete/create/move files, run programs, without alot of logic (if statements, loops, etc)

    For the email portion i suggest setting up an email program to get your email (i.e Microsoft Outlook) since it does exactly what you described.
  7. Aug 17, 2007 #6


    User Avatar
    Science Advisor

    FYI, you can get a beta release of Visual Studio codename Orcas (the coming VS release) for free from Microsoft, which, like Visual Studio 2005, is much superior to Visual Studio .NET and highly recommended.
    You can also get free express editions of Visual C#, VB.NET... etc.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?

Similar Discussions: How should i do things liek this?