Jass Posted July 19, 2010 Share Posted July 19, 2010 Hey out there, I wrote a really simple script which I'd like to get a bit more comfortable. Here is it: $file = FileReadLine(@WorkingDir & "\files\Settings.ini",10) MsgBox(4096,"Pfadfinder","Logfile: " & @AppDataDir & "\PTPU" & $file) Line one reads a specific line from an ini-file to get a filename of a logfile. Line two creates a MsgBox just with the path and the filename. The more comfort I'd like to get is that the text in the message box should link to the directory and the file so the user doesn't have to search the path in explorer himself. Thanks in advance. Jass Link to comment Share on other sites More sharing options...
evilertoaster Posted July 19, 2010 Share Posted July 19, 2010 (edited) Doing that is actually much harder than it sounds, simple message boxes do not have a way to simply make 'links'. You'd have to create a custom GUI, make it look like a MsgBox, and add the link text in as a label with an event handler to handle the clicking of, and possibly scrolling over (to change the mouse icon into the 'pointing finger' common for hot-links). Edited July 19, 2010 by evilertoaster Link to comment Share on other sites More sharing options...
Jass Posted July 20, 2010 Author Share Posted July 20, 2010 Ok thanks, this is too muck work for such a small program Link to comment Share on other sites More sharing options...
KaFu Posted July 20, 2010 Share Posted July 20, 2010 (edited) $file = FileReadLine(@WorkingDir & "\files\Settings.ini", 10) $sLogfile = @AppDataDir & "\PTPU" & $file ClipPut($sLogfile) If MsgBox(4 + 4096, "Pfadfinder", "Logfile: " & $sLogfile & @CRLF & "Location has been copied to clipboard. Paste to Explorer Address Bar and hit Enter." & @CRLF & @CRLF & "Alternativly you can directly open the path in a new Explorer window. Do you want to proceed?") = 6 Then $sLogfile_Dir = StringRight($sLogfile, StringInStr($sLogfile, "\", 0, -1)) ShellExecute($sLogfile_Dir) EndIf Edited July 20, 2010 by KaFu OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Jass Posted July 21, 2010 Author Share Posted July 21, 2010 Thanks a lot KaFu! I did two small changes on your code, that's what I now use: $file = FileReadLine(@WorkingDir & "\files\Settings.ini", 10) $sLogfile = @AppDataDir & "\PTPU\" & $file ClipPut($sLogfile) If MsgBox(4 + 4096, "Pfadfinder", "Logfile: " & $sLogfile & @CRLF & "Location has been copied to clipboard. Paste to Explorer Address Bar and hit Enter." & @CRLF & @CRLF & "Alternativly you can directly open the path in a new Explorer window. Do you want to proceed?") = 6 Then $sLogfile_Dir = @AppDataDir & "\PTPU" ShellExecute($sLogfile_Dir) EndIf Line two a backslash after "\PTPU" was missing and I just use the path, not with filename for ShellExecute to jump to the folder. But, as I said, thanks a lot Link to comment Share on other sites More sharing options...
KaFu Posted July 21, 2010 Share Posted July 21, 2010 I did two small changes on your code, that's what I now use:Looks good ...Line two a backslash after "\PTPU" was missingMe bad, copied&pasted the error from your first post ...and I just use the path, not with filename for ShellExecute to jump to the folder.$sLogfile_Dir = StringRight($sLogfile, StringInStr($sLogfile, "\", 0, -1))should just strip the filename from $sLogfile, wasn't sure if the filename in the Settings.ini not might consist of something like "subdir\subdir\logfile.log", then the $sLogfile_Dir would point to @AppDataDir & "\PTPU\subdir\subdir". OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Jass Posted July 21, 2010 Author Share Posted July 21, 2010 Looks good ...Me bad, copied&pasted the error from your first post ...Hehe, nice, my fault and you liked it Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now