Jump to content

open .txt ?


 Share

Recommended Posts

Hi..

i testet but i dont know how to open a .txt

here is my script:

Case $msg = $ok6button

$msg = Msgbox(1,"Tool made by HoOnda","Read script")

if $msg = 2 then

;

else

$file = Run("items\et_class.txt")

endif

Run("items/et_class.txt") .. is wrong.. what i have to write?

Link to comment
Share on other sites

If you want to open the program associated with .txt files and have it open the .txt of your choice, then you need to use ShellExecute. Here is a link to some code: http://www.autoitscript.com/forum/index.ph...topic=13355&hl=

Search the rest of the forum, there are many examples.

It would be easier to help if you explained exactly what you are trying to do. It may seem obvious to you what you are trying to do, but it is not for us!

“Give a man a script; you have helped him for today. Teach a man to script; and you will not have to hear him whine for help.”AutoIt4UE - Custom AutoIt toolbar and wordfile for UltraEdit/UEStudio users.AutoIt Graphical Debugger - A graphical debugger for AutoIt.SimMetrics COM Wrapper - Calculate string similarity.

Link to comment
Share on other sites

$filex = "C:\program files\blah.txt"
start($filex)
func start($filex)
    If Not FileExists($filex) Then Return 0
    Return Run(@ComSpec & " /c " & "start " & FileGetShortName($filex),"",@SW_RESTORE)
endfunc

--hope this helps

Edited by cdkid
AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!
Link to comment
Share on other sites

  • Moderators

Nice example there cdkid... but if you don't want to see the cmd I'd use @SW_HIDE rather than @SW_RESTORE.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Touche!:P

good point

AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...