- Can I use Virtualbox in a virtual machine without installing mouse or keyboard hooks? I read that AutoHotkey can't send clicks or keystrokes.
- Can I set up using WinMenuSelectItem?
- Does anyone have any scripts for this app?
Virtualbox questions.
Virtualbox questions.
Re: Virtualbox questions.
Although I do not use Virtualbox, this AHK forum has a search form in the top right corner. When I tried it, there were 82 matches. Some of these might have scripts or answer the question, "Can I use Virtualbox in a virtual machine?"-- or you could always test it!
Re: Virtualbox questions.
Am I missing something:
Code: Select all
#IfWinExist, ahk_exe VirtualBox.exe
#v::
WinMenuSelectItem, Oracle VM VirtualBox Manager,, Machine, New
Re: Virtualbox questions.
During your testing, I recommend removing the #If directive. I also suggest that Return should end a hotkey routine.
WinMenuSelect... works only in some programs. If not already mentioned elsewhere in the forum, others here can comment on whether it works in some way for Virtualbox.
WinMenuSelect... works only in some programs. If not already mentioned elsewhere in the forum, others here can comment on whether it works in some way for Virtualbox.
Re: Virtualbox questions.
Oh I forgot the return, and still not working:
Ctrl+N works as well as selecting menus with Alt with the first letter of the menu name and the arrow keys. Is there a way to tell this is a Win32 window?
Code: Select all
IfWinExist, ahk_exe VirtualBox.exe
^+v::
WinMenuSelectItem, Oracle VM VirtualBox Manager,, Machine, New
return
Ctrl+N works as well as selecting menus with Alt with the first letter of the menu name and the arrow keys. Is there a way to tell this is a Win32 window?
Re: Virtualbox questions.
When I suggested removing #If, I did not suggest using If instead. Further, your new command will not work there, so I would remove it. During your testing, there is no need for the #If directive, because you are simply trying to see whether your menu selection command will work.
I do not know about your Win32 question, but perhaps running Window Spy will help you to confirm the WinTitle.
That's about all the help that I know how to offer on this one. Best wishes for success!
I do not know about your Win32 question, but perhaps running Window Spy will help you to confirm the WinTitle.
That's about all the help that I know how to offer on this one. Best wishes for success!
Re: Virtualbox questions.
Could you correct me? What I want to do is if Virtualbox isn't open then it will open and in either case it presses ^s.
Re: Virtualbox questions.
An example of how to run a program is below.
Code: Select all
proc = C:\Windows\System32\notepad.exe ; Replace with your program's path
winTitle = ahk_exe %proc%
^+v::
Run, % WinExist(winTitle) ? "" : proc
WinWait, %winTitle%,, 5
If !ErrorLevel {
WinActivate
Send ^s
} Else MsgBox, 48, Error, Window not found.`n`n%winTitle%
Return
Re: Virtualbox questions.
Thanks, my I add this other script in front of it:
Code: Select all
FileSelectFile, OutputVar, Options, ::{374DE290-123F-4565-9164-39C4925E467B}
Clipboard := OutputVar
MsgBox, The path(s) of selected file(s): `n`n%ClipBoard%
Return
Re: Virtualbox questions.
You have full permission to give it a go & see what happens! Experimentation is a human quality!
Re: Virtualbox questions.
Sorry, I meant to ask how do I do this. I use speech recognition software and have a habit of not checking bro.
Re: Virtualbox questions.
You would insert the lines into your script in the place where you would like them to execute.
Re: Virtualbox questions.
I see, I just needed to get rid of a Return.
Re: Virtualbox questions.
What I want to do is
- Copy to the clipboard input from InputBox, UserInput, Enter Name, Please enter the virtual machine name:, , 300, 150, or a GUI, using ClipbordAll to store it.
- *The copy text from this is it is as well:
FileSelectFile, OutputVar, Options, ::{374DE290-123F-4565-9164-39C4925E467B}
Clipboard := OutputVar
MsgBox, The path(s) of selected file(s): `n`n%ClipBoard% - Be able to paste those 2 text items into the text fields in Virtualbox.
Re: Virtualbox questions.
Code: Select all
InputBox, str, VM, Please enter the virtual machine name.,, 300, 125
If !ErrorLevel { ; User did not press Cancel or ESC
Clipboard := "", Clipboard := str
ClipWait, 0
If !ErrorLevel { ; Clip succeeded
Send ^v
FileSelectFile, str,, % StrReplace(A_AppData, "AppData\Roaming", "Downloads")
If !ErrorLevel { ; User did not press Cancel or ESC
Clipboard := "", Clipboard := str
ClipWait, 0
If ErrorLevel
MsgBox, 48, Error, An error occurred while waiting for the clipboard.
Else Send ^v
}
} Else MsgBox, 48, Error, An error occurred while waiting for the clipboard.
}
Re: Virtualbox questions.
How can I store the text items as two variables?
Last edited by LAPIII on 14 Jun 2022, 11:21, edited 2 times in total.
Re: Virtualbox questions.
Time to learn. The script already shows examples of variable assignments.
Re: Virtualbox questions.
Can you help me with missing }:
Code: Select all
InputBox, str1, VM, Please enter the virtual machine name.,, 300, 125
If !ErrorLevel { ; User did not press Cancel or ESC
Clipboard := "", Clipboard := str1
FileSelectFile, str2,, % StrReplace(A_AppData, "AppData\Roaming", "Downloads")
If !ErrorLevel { ; User did not press Cancel or ESC
Clipboard := "", Clipboard := str2
Re: Virtualbox questions.
Altogether, the number of open { should match the number of closing }. See blocks.
Current count: 2 open { , 0 closing }
Current count: 2 open { , 0 closing }
Re: Virtualbox questions.
It looks like I need to grab the Settings window in Virtualbox. How can I go about that? The process is the same and the title contains - Settings.