adored Posted June 27, 2006 Share Posted June 27, 2006 Hey, i'd like to make a function that opend eg. a program if you type a url in your browser, like this scite://my_program1 starts SciTe en opens my_program1.au3 Great thnx, adored Link to comment Share on other sites More sharing options...
PsaltyDS Posted June 27, 2006 Share Posted June 27, 2006 Hey, i'd like to make a function that opend eg. a program if you type a url in your browser, like this scite://my_program1 starts SciTe en opens my_program1.au3 Great thnx, adored Put the following in the address bar of IE: file:///c:\My_Folder\My_Program1.au3 It opens in SciTE on my computer. Does not work in Firefox (probably considered a security risk). Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
adored Posted June 27, 2006 Author Share Posted June 27, 2006 (edited) Put the following in the address bar of IE: file:///c:\My_Folder\My_Program1.au3 It opens in SciTE on my computer. Does not work in Firefox (probably considered a security risk). the scite thingy was only a example. i want to place a link on my webpage like program://file so it starts the program and opens the file edit// if you know skype with skype you can do this skype://skype_name the link starts skype and calls the skype name Edited June 27, 2006 by adored Link to comment Share on other sites More sharing options...
DaleHohm Posted June 27, 2006 Share Posted June 27, 2006 the scite thingy was only a example.i want to place a link on my webpage like program://fileso it starts the program and opens the fileedit//if you know skypewith skype you can do this skype://skype_namethe link starts skype and calls the skype nameThe answer is in MSDN: Registering an Application to a URL ProtocolDale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
Valuater Posted June 27, 2006 Share Posted June 27, 2006 from the original question.. not the link Dim $File_location = FileGetShortName("C:\Program Files\AutoIt3\Examples\My Stuff\") Opt("WinTitleMatchMode", 4) HotKeySet("{F9}", "Run_it") While 1 Sleep(500) WEnd Func Run_it() If ProcessExists("iexplore.exe") Then $FileName = ControlGetText("classname=IEFrame","", 41477) ToolTip($FileName, 0, 0) If StringLeft( $FileName, 5) = "Scite" Then $result = StringSplit($FileName, "\\", 1) ;MsgBox(64,"test string", $File_location & $result[2]) RunWait(@ComSpec & ' /c start ' & $File_location & $result[2], '', @SW_HIDE) EndIf Else ToolTip("Internet Explorer was not running", 0, 0) EndIf Sleep(2000) ToolTip("") EndFunc 8) Link to comment Share on other sites More sharing options...
eltorro Posted June 29, 2006 Share Posted June 29, 2006 Here's a protocol handler routine to take care of a scite://whatever.au3 url. expandcollapse popup;=============================================================================== ;eltorro <steve@ocotillo.sytes.net> ;launch scite from browser with parameter ; ;compile and run from the cmdline to add protocol handler to registry ; SciTeUrl.exe -reg ;example scite://C:\Program Files\Autoit3\scripts\my_new_script.au3 ;works with firefox 1.5.0.4, IE6 ;=============================================================================== #region - Compiler directives section ;if you change the name of the OutFile #Compiler_OutFile="C:\WINDOWS\SciTeUrl.exe" #endregion ;then you need to change it here too. Local $sciteurl = "C:\WINDOWS\SciTeUrl.exe" ;Put you path to scite here. This is default. Local $scite = "C:\Program Files\AutoIt3\SciTe\SciTe.exe" ;=============================================================================== If $CmdLine[0] > 0 Then If $CmdLine[1] <> "-reg" Then Local $file = StringSplit(StringReplace($CmdLineRaw,chr(34),""), "://", 1) If Not @error Then While StringRight($file[2], 1) = "/" Or StringRight($file[2], 1) = Chr(34) $file[2] = StringTrimRight($file[2], 1) WEnd ; MsgBox(266288, "URL:Protocol Handler", "Opening file in Scite...",3) Run('"' & $scite & '" "' & $file[2] & '"') EndIf Else RegWrite("HKCR\scite", "", "REG_SZ", '"URL:Scite Protocol"') RegWrite("HKCR\scite", "URL Protocol", "REG_SZ", '""') RegWrite("HKCR\scite\DefaultIcon", "", "REG_SZ", '"' & $scite & '"') RegWrite("HKCR\scite\shell\open\command", "", "REG_SZ", '"' & $sciteurl & '" "%1"') MsgBox(266288, "RegWrite", "Registry Entries Added." & @LF) EndIf EndIf ;~ Windows Registry Editor Version 5.00 ;~ [HKEY_CLASSES_ROOT\scite] ;~ @="URL:Scite Protocol" ;~ "URL Protocol"="\"\"" ;~ [HKEY_CLASSES_ROOT\scite\DefaultIcon] ;~ @="\"C:\\Program Files\\AutoIt3\\SciTe\\SciTe.exe\"" ;~ [HKEY_CLASSES_ROOT\scite\shell] ;~ [HKEY_CLASSES_ROOT\scite\shell\open] ;~ [HKEY_CLASSES_ROOT\scite\shell\open\command] ;~ @="\"C:\\Windows\\SciTeUrl.exe\" \"%1\"" Regards, eltorro Regards, [indent]ElTorro[/indent][font="Book"] Decide, Commit, Achieve[/font]_ConfigIO.au3Language Translation --uses Google(tm) MsgBox Move XML wrapper UDF XML2TreeView Zip functionality Split your GUI Save Print ScreenZipPluginEdit In Place listviewSome of my scripts on Google code Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 29, 2006 Moderators Share Posted June 29, 2006 That's nice steve (eltorro)! 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 More sharing options...
RidgeCat Posted May 30, 2007 Share Posted May 30, 2007 The answer is in MSDN: Registering an Application to a URL ProtocolDaleThanks for the lead, Dale. BTW, Microsoft has changed the link to this article (who'd a thunk it?) to http://msdn2.microsoft.com/en-us/library/Aa767914.aspx 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