AutoHotkey Community

It is currently May 27th, 2012, 10:22 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 232 posts ]  Go to page Previous  1 ... 12, 13, 14, 15, 16
Author Message
 Post subject:
PostPosted: August 10th, 2011, 7:03 am 
Offline

Joined: June 27th, 2007, 9:07 pm
Posts: 101
Location: California
alanesq wrote:
Can someone point me in the right direction please as I am having trouble getting ws4ahk.ahk to work for me

Whatever I try to run I just get the error "Windows Scripting has not been initialized"

I have ws4ahk.ahk in the same folder as my script and I use VBScript a lot so I know it is installed and working on my PC ok

The errorlevel is: [-2147221005] CLSIDFromProgID: error -2147221005


You may be the first person to post their ErrorLevel in 4 years. Good job :)
Please also share what version of Autohotkey you are running, and system specs.

_________________
-m35


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 10th, 2011, 12:40 pm 
Offline

Joined: August 7th, 2011, 10:30 am
Posts: 7
Location: Nottingham, England
Thanks for the reply

I am using AutoHotKey_L version 1.1.01.00 (although I have just upgraded to 1.1.02.00 but still the same)
I have just downloaded the latest version of ws4ahk.ahk (.21 beta I think it said)

I am running Windows XP 32 bit with SP2 (I have tried it on 2 of my computers but same on both)

BTW - I have now found another way to do what I wanted to do with this so it is no longer vital, but it would be good to get it working anyway


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 15th, 2011, 2:33 pm 
Offline

Joined: June 27th, 2007, 9:07 pm
Posts: 101
Location: California
alanesq wrote:
I am using AutoHotKey_L version 1.1.01.00 (although I have just upgraded to 1.1.02.00 but still the same)
I have just downloaded the latest version of ws4ahk.ahk (.21 beta I think it said)


I haven't used the AutoHotKey_L version of AHK, but I believe ws4ahk may not be compatible with it (I know it's not compatible with the Unicode version). The _L versions have COM support built in, so I would recommend utilizing that for future COM work.

_________________
-m35


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 12th, 2011, 6:50 pm 
Offline

Joined: December 26th, 2010, 7:40 pm
Posts: 4172
Location: Awesometown, USA
I feel it worth noting the AHK_L solution in this thread:
Code:
SC := ComObjCreate("ScriptControl")
SC.Language := "VBScript"
code =
(
intAns = MsgBox("Hello World", 4)
If intAns = vbYes then
 strAns = "Yes"
else
 strAns = "No"
end If
MsgBox("You pressed " & strAns & ".")
)
SC.ExecuteStatement(code)
My apologies if it has already been mentioned.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 12th, 2012, 11:14 am 
Quote:
I feel it worth noting the AHK_L solution in this thread:
Code (Copy):
SC := ComObjCreate("ScriptControl")
SC.Language := "VBScript"
code =
(
intAns = MsgBox("Hello World", 4)
If intAns = vbYes then
strAns = "Yes"
else
strAns = "No"
end If
MsgBox("You pressed " & strAns & ".")
)
SC.ExecuteStatement(code)
My apologies if it has already been mentioned.


Is there a way how to use/access the var "strAns" in the following ahk script?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 12th, 2012, 12:38 pm 
Offline

Joined: August 7th, 2011, 1:23 pm
Posts: 754
Quote:
Is there a way how to use/access the var "strAns" in the following ahk script?

Yes, using SC.Eval
Code:
SC.ExecuteStatement(code)
MsgBox, 64, AutoHotkey MsgBox, % "The value from VBS var strAns is:`n" SC.Eval("strAns")

_________________
Win7 - Firefox 10.0.2 - AHK_L 1.1.07.00
Please bear with me and my English which is so bad at times that even I don't understand myself


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 12th, 2012, 2:35 pm 
works wonderful! Thank you. :D
I ask myself if it would be better to run vbs/vba code with this method or to convert the code to ahk_L syntax?

One advantage to run it with ...ExecuteStatement... and ...Eval...method could be that it's easier to handle for newbies...


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 232 posts ]  Go to page Previous  1 ... 12, 13, 14, 15, 16

All times are UTC [ DST ]


Who is online

Users browsing this forum: XX0 and 26 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group