Connecting Tech Pros Worldwide Help | Site Map

vbscript

Newbie
 
Join Date: Jun 2006
Posts: 5
#1: Jun 26 '06
sorry i have to bother you guys with this, because this really is a noob question.
i have this .vbs file, and i want to execute the code by the onmousedown event in html. I can't just link to the file cause then my browser just lets me see the vbs code
Anyone help me please :confused:
Banfa's Avatar
AdministratorVoR
 
Join Date: Feb 2006
Location: South West UK
Posts: 6,162
#2: Jun 26 '06

re: vbscript


Unless you can embed the script you want to run with-in an html page like so

[html]
<html>
<head>
</head>
<body>
<script language="vbscript">
/* Your script here */
</script>
</body>
</html>
[/html]

then I suspect you will find that you can not just run a VBScript (*.vbs) on mouse down as this would be a major security headache because all sorts of unscrupulous things could be done.

If you can embed the script in an html page the you could run it by opening the page in a new window and then closing the window again.
Newbie
 
Join Date: Jun 2006
Posts: 5
#3: Jun 26 '06

re: vbscript


this is the code of the script, it's for letting itunes toggle between play and pause

' Variables
dim iTunes, CurState


' Connect to iTunes app
set iTunes = CreateObject("iTunes.Application")


' Get current state
CurState = iTunes.PlayerState


' Do the appropriate thing
select case CurState
case 0
' Stopped
iTunes.PlayPause

case 1
' Playing
iTunes.PlayPause

case 2
' Fast-forwarding
iTunes.Resume

case 3
' Rewinding
iTunes.Resume

end select


' Done; release object
set iTunes = nothing

i wanna create a way that i can control itunes in my browser, by executing this script. isn't there a good way?
Newbie
 
Join Date: Jun 2006
Posts: 5
#4: Jun 27 '06

re: vbscript


another stupid question: can't i just translate it into javascript
Banfa's Avatar
AdministratorVoR
 
Join Date: Feb 2006
Location: South West UK
Posts: 6,162
#5: Jun 27 '06

re: vbscript


You might be able to, you are moving behond what I know, good lick :D
Reply


Similar Visual Basic 4 / 5 / 6 bytes