anixon Posted December 3, 2010 Share Posted December 3, 2010 How do you launch an htm document that is associated with say Safari using the users default browser which might be iExplore. I have tried the following code which does not work. What am I missing? run(@scriptdir & "\Help\test.htm") Help is always appreciated Ant.. Link to comment Share on other sites More sharing options...
taietel Posted December 3, 2010 Share Posted December 3, 2010 Try ShellExecute(@ScriptDir & "\Help\test.htm") Things you should know first...In the beginning there was only ONE! And zero... Progs: Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text Link to comment Share on other sites More sharing options...
anixon Posted December 3, 2010 Author Share Posted December 3, 2010 Try ShellExecute(@ScriptDir & "\Help\test.htm")Thanks for that it works but gives rise to another question and that is how do you open the document on subsequent occasions without the 'Blocked content message? Ant.. Link to comment Share on other sites More sharing options...
taietel Posted December 3, 2010 Share Posted December 3, 2010 I'll go for hta file instead changing IE settings. Things you should know first...In the beginning there was only ONE! And zero... Progs: Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text Link to comment Share on other sites More sharing options...
anixon Posted December 3, 2010 Author Share Posted December 3, 2010 I'll go for hta file instead changing IE settings.The document is created in Word and saved as a web page what program would you use that saves in hta format? Ant.. Link to comment Share on other sites More sharing options...
taietel Posted December 3, 2010 Share Posted December 3, 2010 there is no need for that! read here about hta.try to change the extension of test.htm in .hta and run it. Things you should know first...In the beginning there was only ONE! And zero... Progs: Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text Link to comment Share on other sites More sharing options...
anixon Posted December 3, 2010 Author Share Posted December 3, 2010 there is no need for that! read here about hta.try to change the extension of test.htm in .hta and run it. Link to comment Share on other sites More sharing options...
taietel Posted December 3, 2010 Share Posted December 3, 2010 ... and that means it worked or not?  I don't understand... Things you should know first...In the beginning there was only ONE! And zero... Progs: Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text Link to comment Share on other sites More sharing options...
anixon Posted December 3, 2010 Author Share Posted December 3, 2010 ... and that means it worked or not? I don't understand...Thank you for the information your solution is working perfectly.I created the document in Word with some text, tables and images saved it as a htm document. Then launched Safari opened the htm file and saved it as a HTA which has delivered exactly what was required. It has been a valuable lesson which I can assure you has been very much appreciated thanks again for your help. Ant.. Link to comment Share on other sites More sharing options...
taietel Posted December 3, 2010 Share Posted December 3, 2010 No problem, mate! Glad I could help!  M.I. Things you should know first...In the beginning there was only ONE! And zero... Progs: Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text Link to comment Share on other sites More sharing options...
anixon Posted December 3, 2010 Author Share Posted December 3, 2010 No problem, mate! Glad I could help! M.I.'Mate' that is very Australian of you thanks Given that HTA is a Microsoft function applicable to iExplore it does not work with Safari so the question is how do you determine what is the users default browser so that you can choose what file type to launch? Ant.. Link to comment Share on other sites More sharing options...
taietel Posted December 3, 2010 Share Posted December 3, 2010 (edited) When you execute hta via ShellExecute, it will open with IE, even if it's not the default browser. [edit] I know about "mate" from TV and from a very good scripter, enaiman. Edited December 3, 2010 by taietel Things you should know first...In the beginning there was only ONE! And zero... Progs: Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text Link to comment Share on other sites More sharing options...
anixon Posted December 3, 2010 Author Share Posted December 3, 2010 I guess there is an assumption that the User has iExplorer installed. Would it not be better to have two file types one that can be launched in iExplorer and the other in some other Browser like Safari? Ant.. Link to comment Share on other sites More sharing options...
anixon Posted December 3, 2010 Author Share Posted December 3, 2010 When you execute hta via ShellExecute, it will open with IE, even if it's not the default browser. [edit] I know about "mate" from TV and from a very good scripter, enaiman. Yes I know enaiman he lives not far from me but I would have to catch a boat to get there... Ant... Link to comment Share on other sites More sharing options...
taietel Posted December 3, 2010 Share Posted December 3, 2010 If it has windows, there is no problem. Have you tried with Safary as default browser? For precaution, you can use as you said two files. If IE is default, execute HTA; if not default or error execute htm file Things you should know first...In the beginning there was only ONE! And zero... Progs: Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text Link to comment Share on other sites More sharing options...
anixon Posted December 3, 2010 Author Share Posted December 3, 2010 If it has windows, there is no problem. Have you tried with Safary as default browser?For precaution, you can use as you said two files. If IE is default, execute HTA; if not default or error execute htm fileYes works with Safari as a htm file but not after it has been converted to a HTA file. I guess I can read Registry to determine the default Browser and then if its iExplore launch the HTA file otherwise the htm Ant.. Link to comment Share on other sites More sharing options...
taietel Posted December 3, 2010 Share Posted December 3, 2010 You're right!I did a search on See if it helps!I'm going to take a nap, because my f***ing toothache is finally gone!!. Cheers!M.I. Things you should know first...In the beginning there was only ONE! And zero... Progs: Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text Link to comment Share on other sites More sharing options...
anixon Posted December 3, 2010 Author Share Posted December 3, 2010 You're right! I did a search on See if it helps! I'm going to take a nap, because my f***ing toothache is finally gone!!. Cheers! M.I. Thanks for your help I think that this probably gets the information that I need Const $BrowserID = RegRead("HKCU\Software\Clients\StartMenuInternet", "") MsgBox(0,"",$BrowserID) In my youth which was 60 odd years ago we used to use and this is purely from memory which on occasions I think has departed to an unknown destination anyway I think it was a product called 'Oil of Cloves' which you used to apply to the offending tooth. Anyway best wishes and thanks for you help again and I hope that everything goes well for you and yours during the holiday season and new year. Ant.,. Link to comment Share on other sites More sharing options...
taietel Posted December 3, 2010 Share Posted December 3, 2010 No need to thank me. Was my pleasure! Thanks for the tip regarding the toothache. Best wishes to you too! Mihai Iancu Things you should know first...In the beginning there was only ONE! And zero... Progs: Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text Link to comment Share on other sites More sharing options...
anixon Posted December 3, 2010 Author Share Posted December 3, 2010 (edited) No need to thank me. Was my pleasure! Thanks for the tip regarding the toothache. Best wishes to you too! Mihai Iancu This is how the code looks expandcollapse popupAutoItSetOption("WinTitleMatchMode", 4) ;//Call the routine _BrowserProcessor(@ScriptDir & "\help\test") ;//Browser Processor Func _BrowserProcessor($FileId) While 1 ;//Determine Default Browser $BrowserID = RegRead("HKCU\Software\Clients\StartMenuInternet", "") ;//File based on iExplore as default browser If $BrowserID = $iExplore Then $FileId = $FileId & ".hta" Else $FileId = $FileId & ".htm" EndIf ;//Open the File If FileExists($FileId) Then ShellExecute($FileId) Sleep(500) ;//Compulsory Exit [5 Minutes] $sMsgTimerX = _DateAdd("n", 5, _NowCalcDate() & " " & @HOUR & ":" & @MIN & ":" & @SEC) While 1 $handle = WinGetHandle($FileId, "") If $handle = "" Then ExitLoop (2) ;//Compulsory Exit If _NowCalc() >= $sMsgTimerX Then MsgBox(0, "", "Exiting UAC Help", 5) WinKill($FileId, "") ExitLoop (2) EndIf Sleep(100) WEnd EndIf ;//Default Text FileID If FileExists($FileId & ".txt") Then ;//Open Default file in Notepad _AutoNotepadExe($sESVista, $sLogDirHelp, $Width - ($nPWidth755 / 2), $nPHeightY, $nPWidth755, $nPHeight, 1000) ExitLoop EndIf MsgBox(64, "", "Default " & $FileId & " File NOT FOUND", $EndMenuTimer) ExitLoop WEnd EndFunc ;==>_BrowserProcessor 3rd Code Edit Edited December 4, 2010 by anixon 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