 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Rajat
Joined: 28 Mar 2004 Posts: 1687
|
Posted: Fri Apr 23, 2004 2:25 am Post subject: Generate GUIs easily! |
|
|
This isn't usually known either... any .htm (or .html) file can be renamed to .hta (Hyper Text Application) to make it run actually like an application, no browser address bar, no toolbar buttons... no nonsenese! also fewer message boxes while clicking on links. (i've used it in the winamp info display example i posted)
one can make good use of it by generating html files using 'FileAppend' and run them using '%comspec% /c start'. they can have animated gifs, tables, buttons, input fields... anything u need to create a GUI. the java guys can make the inputs inserted in the fields be written to files, that the source script can use. (don't ask me how, i don't know java, maybe somebody will care to put up an example here)
also for making cool looking splashtexts just after generating the .hta file do this:
| Code: | runwait, %comspec% /c start generated.hta,,hide
sleep, 1000
winclose, (the title of the page here) |
_________________
 |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10667
|
Posted: Fri Apr 23, 2004 2:29 am Post subject: |
|
|
Wow you're a goldmine of info. Why reinvent the wheel when you can use a cool tip from Rajat!  |
|
| Back to top |
|
 |
beardboy
Joined: 02 Mar 2004 Posts: 443 Location: SLC, Utah
|
Posted: Fri Apr 23, 2004 4:51 am Post subject: |
|
|
Keep them coming Rajat!!!
thanks,
beardboy |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10667
|
Posted: Fri Apr 23, 2004 5:35 am Post subject: |
|
|
| Quote: | | runwait, %comspec% /c start generated.hta,,hide |
I think you can run those files directly. AHK can run just about any file extension as long as it's associated with something. So it probably performs a little better this way:
runwait, generated.hta |
|
| Back to top |
|
 |
Rajat
Joined: 28 Mar 2004 Posts: 1687
|
Posted: Fri Apr 23, 2004 6:46 am Post subject: |
|
|
oh that's great!... i was still living with AU2 usage!
though now it's reqd to be changed to:
or the script won't move ahead! (unless one wants the script to stop untill the window is closed) _________________
 |
|
| Back to top |
|
 |
Beastmaster
Joined: 15 Apr 2004 Posts: 181
|
|
| Back to top |
|
 |
Rajat
Joined: 28 Mar 2004 Posts: 1687
|
Posted: Fri Apr 23, 2004 3:32 pm Post subject: |
|
|
thanx for the link BeastMaster, was good help. _________________
 |
|
| Back to top |
|
 |
tank
Joined: 21 Dec 2007 Posts: 2413 Location: Louisville KY USA
|
Posted: Mon Dec 24, 2007 7:44 pm Post subject: |
|
|
Digging thru all of the forum articles
good god man
i have been doing html for 10 years and programming for 4+
where the heck do you come up with this stuff
wow
no more using javascript for modeless windows for me this solves so many issues its just not funny _________________ Basic Webpage Controls with JavaScript / COM - Tutorial by Jethrow
 |
|
| Back to top |
|
 |
ChalamiuS
Joined: 04 Jun 2006 Posts: 176 Location: ::1
|
Posted: Wed Dec 26, 2007 5:29 pm Post subject: |
|
|
hah I found out this a week ago and this has been here for longer than that  |
|
| Back to top |
|
 |
TylerK
Joined: 21 Aug 2007 Posts: 7 Location: Springfield, IL
|
Posted: Wed Dec 26, 2007 7:23 pm Post subject: |
|
|
Ohhhhh, this is awesome! Lately I've been setting up custom scripts for various buttons on my PC's remote control and I must say that this method is a heck of a lot easier for certain things than a normal GUI would be.
One thing that's very fun to do is have a script download several different web pages, then use RegExReplace to strip out all the junk you don't want from them. Once that's done you can easily insert the isolated content into a new .hta document and have the script run it maximized. You could even have your computer read certain parts to you if you so choose (I like to do it for weather, news, descriptions on "picture of the day" websites, titles of new threads on forums that I frequent, etc). |
|
| Back to top |
|
 |
garry
Joined: 19 Apr 2005 Posts: 1557 Location: switzerland
|
Posted: Wed Dec 26, 2007 8:24 pm Post subject: |
|
|
is it possible to give x,y coordinate width and height and only see video ?
example , start youtube, select movie, then start a new small xy.hta see only video
related, see video in internet with black background
http://www.autohotkey.com/forum/topic26935.html
http://www.autohotkey.com/forum/topic26834.html
can watch film here, after a few seconds the background will be black
http://quicksilverscreen.com/
starturl.hta: (no success with margin)
| Code: | <HTML>
<!This comment will not be displayed>
<HEAD><TITLE>Browser</TITLE></HEAD>
<BODY>
<BODY BGCOLOR="#000000"
TEXT=WHITE
LINK=BLUE
VLINK=PURPLE
ALINK=RED
>
<IFRAME SRC="http://www.youtube.com/watch?v=iCKMzrPy4t4"
WIDTH=490 HEIGHT=390
ALIGN=LEFT
HSPACE=100 VSPACE=60
MARGINWIDTH=-260
MARGINHEIGHT=-230
FRAMEBORDER=1
SCROLLING=AUTO
</IFRAME>
</BODY>
</HTML>
|
starturl.hta
 |
|
| Back to top |
|
 |
TylerK
Joined: 21 Aug 2007 Posts: 7 Location: Springfield, IL
|
Posted: Thu Dec 27, 2007 2:37 am Post subject: |
|
|
| garry wrote: | is it possible to give x,y coordinate width and height and only see video ?
example , start youtube, select movie, then start a new small xy.hta see only video | A better way to do it would be to use the embed code that YouTube gives you for the video. People usually use it for blogs and myspace, but there's no reason it won't work in an .hta file.
I thought your idea was neat, however, so I decided to take a shot at coding it. Basically the script grabs a basic (local) template for displaying a YouTube video but replaces the video ID with one that you specify, then it creates a new hta file, executes it, and resizes it so it's just big enough for the video to be displayed.
Here's the html template (in the code it's referenced as YouTubeTemplate.txt, which is stored in the same directory as the script):
| Code: | <HTML>
<HEAD>
<TITLE>YouTube Viewer</TITLE>
<style type="text/css">
body {
background-color: #000000;
margin: 0px;
padding: 0px;
color: #fff;
overflow-y: hidden;
}
</style>
</HEAD>
<BODY>
<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/--vidID--&rel=1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/--vidID--&rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>
</BODY>
</HTML> |
The "overflow-y: hidden;" bit of CSS will hide the vertical scrollbar since it's not needed and is just taking up space.
And here's the script:
| Code: | ; Prompt user for URL to the YouTube video.
InputBox, videoURL, Enter the video's url
; Strip everything but the last bit (the video ID, basically)
videoURL := RegExReplace(videoURL, ".*\?v=", " ")
; Trim the space we just made
StringTrimLeft, videoURL, videoURL, 1
; Grab our template...
FileRead, outputHTML, %A_ScriptDir%\YouTubeTemplate.txt
; Replace the --vidID-- with the actual video ID
StringReplace, outputHTML, outputHTML, --vidID--, %videoURL%, All
; Delete the hta file if it exists so that we don't keep adding to it
FileDelete, %A_ScriptDir%\YouTubeViewer.hta
; Then make a new one and put the output HTML into it and run it
FileAppend, %outputHTML%, %A_ScriptDir%\YouTubeViewer.hta
Run, %A_ScriptDir%\YouTubeViewer.hta
; This will resize the window so it's only big enough to show the video.
; You may need to change the dimensions below since title bar thickness
; can vary depending on desktop themes and such.
WinWait, YouTube Viewer
WinMove, YouTube Viewer,,,,440,395 |
Getting the video's URL via InputBox is just a quick, dirty, proof-of-concept way to do it. You could do some clever stuff like scan your internet bookmarks for YouTube links and present a list of them in a GUI - a YouTube DVR of sorts. |
|
| Back to top |
|
 |
garry
Joined: 19 Apr 2005 Posts: 1557 Location: switzerland
|
|
| Back to top |
|
 |
TylerK
Joined: 21 Aug 2007 Posts: 7 Location: Springfield, IL
|
Posted: Sat Dec 29, 2007 3:54 am Post subject: |
|
|
| If I'm understanding you correctly, you want to have the video displayed in an AHK GUI? If so you'd have to embed an IE control first. Then, using the script above, you could easily have it output to a .html file instead of a .hta file, then have the IE control in your GUI load the local .html file. |
|
| Back to top |
|
 |
garry
Joined: 19 Apr 2005 Posts: 1557 Location: switzerland
|
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|