![]() |
KnowBrainer Speech Recognition | ![]() |
Topic Title: Failing at creating a simple DVC command in Asana Topic Summary: tab + i Created On: 12/15/2022 12:05 PM Status: Post and Reply |
|
![]() |
![]() |
- brooklyn cabin | - 12/15/2022 12:05 PM |
![]() |
![]() |
- monkey8 | - 12/15/2022 02:18 PM |
![]() |
![]() |
- brooklyn cabin | - 12/15/2022 02:39 PM |
![]() |
![]() |
- Lunis Orcutt | - 12/15/2022 02:21 PM |
![]() |
![]() |
- brooklyn cabin | - 12/15/2022 02:46 PM |
![]() |
![]() |
- monkey8 | - 12/15/2022 02:53 PM |
![]() |
![]() |
- brooklyn cabin | - 12/15/2022 04:15 PM |
![]() |
![]() |
- monkey8 | - 12/15/2022 05:13 PM |
![]() |
![]() |
- brooklyn cabin | - 12/15/2022 08:44 PM |
![]() |
![]() |
- monkey8 | - 12/16/2022 03:58 AM |
![]() |
![]() |
- Alan Cantor | - 12/15/2022 08:59 PM |
![]() |
![]() |
- brooklyn cabin | - 12/16/2022 04:36 PM |
![]() |
![]() |
- brooklyn cabin | - 12/16/2022 05:04 PM |
![]() |
![]() |
- Alan Cantor | - 12/16/2022 09:30 PM |
![]() |
![]() |
- monkey8 | - 12/17/2022 08:10 AM |
![]() |
![]() |
- brooklyn cabin | - 12/19/2022 01:56 PM |
![]() |
![]() |
- brooklyn cabin | - 12/28/2022 12:09 PM |
![]() |
![]() |
- Edgar | - 12/28/2022 05:10 PM |
![]() |
![]() |
- brooklyn cabin | - 12/29/2022 09:41 PM |
![]() |
![]() |
- monkey8 | - 12/30/2022 04:15 AM |
![]() |
![]() |
- brooklyn cabin | - 01/04/2023 09:25 PM |
![]() |
|
My company is starting to use Asana and I'm trying to create a bunch of DVC commands to help me navigate the desktop app. They have a browser version but I figured it would be simpler for me to create keyboard shortcut commands for Desktop, so there won't be any confusion with other browser-based commands that might be similarly titled. Is there anything missing from this command? When I say the command in Asana, I get the red exclamation mark at the top of my Dragon command bar and a string of words in quotation marks like, "close bracket" "close square bracket" etc. |
|
|
|
![]() |
|
|
|
![]() |
|
I would be pressing the two keys at the same time. I've tried it manually and it works. Just can't seem to get it with a speech command in DVC even though it seems very simple. |
|
|
|
![]() |
|
Try SendKeys "{Tab}i" which is also the same for a standard Dragon Advanced-Scripting VB script. If your command executes a little too quickly, try SendSystemKeys "{Tab}i" ------------------------- Change "No" to "Know" w/KnowBrainer 2022 |
|
|
|
![]() |
|
neither of these work for me, Lunis. |
|
|
|
![]() |
|
You are unlikely to do it with DVC so you would need to use Advanced Scripting, try the following script, if it doesn't work put a Wait 0.1 before and after the SendKeys line. If Asana uses lots of tab key combinations you can use the same structure with the other commands you might need. If that doesn't work let me know and I will give you something else to try.
Declare Function keybd_event Lib "user32.dll" (ByVal vKey As _ Long, bScan As Long, ByVal Flag As Long, ByVal exInfo As Long) As Long Const VK_TAB = &h09 Sub Main keybd_event(VK_TAB,0,0,0) SendKeys"i" keybd_event(VK_TAB,0,2,0) End Sub ------------------------- |
|
|
|
![]() |
|
Thanks, Lindsey. I'm getting a syntax error message when I try to create this command. (Screenshot below). I've never made a command this complicated and don't really understand the script so just let me know if I'm missing something.
|
|
|
|
![]() |
|
You must have the top line of your script on 2 separate lines exactly like this: Declare Function keybd_event Lib "user32.dll" (ByVal vKey As _ Long, bScan As Long, ByVal Flag As Long, ByVal exInfo As Long) As Long
The _ at the end of the first line depicts that the function declaration will proceed on the next line. ------------------------- |
|
|
|
![]() |
|
oh, didn't realize that. But even with that, I'm still getting an error message "(1) Syntax Error" when I try to save the command. |
|
|
|
![]() |
|
|
|
![]() |
|
Start from scratch. Make the command Advanced Scripting from the get-go and try again.
|
|
|
|
![]() |
|
Thank you, Lindsey!! The command is working and it's marvelous.
There are probably 50 or so of these two button commands in Asana. I don't need to use them all but I would like to make a bunch more of these. Moving forward, is the trick to replace each instance of "TAB" and "i"? Is there something special about the Tab key as opposed to "i" which was only used once with a simple SendKeys? |
|
|
|
![]() |
|
For instance,if I was going to create a command that required pressing Control and Enter at the same time, would it look like:
Declare Function keybd_event Lib "user32.dll" (ByVal vKey As _ Long, bScan As Long, ByVal Flag As Long, ByVal exInfo As Long) As Long Const VK_CTRL = &h09 Sub Main keybd_event(VK_CTRL,0,0,0) SendKeys"Enter" keybd_event(VK_CTRL,0,2,0) End Sub |
|
|
|
![]() |
|
You may be able to get away with simpler code when outputting key combinations that use standard modifier keys (i.e., Shift, Ctrl, or Alt).
For example, this easy-to-understand example is the equivalent of pressing Ctrl + Enter: Sub Main SendSystemKeys "{Ctrl+Enter}" End Sub |
|
|
|
![]() |
|
Hi Brooklyn, it's not so much that there is anything special about the tab key but the reason that you are using the keybd_event function is that you want to use the tab key as a modifier key meaning you need to simulate holding down the tab key when you press i and then releasing it again, that is something you can't really do with SendKeys other than with the usual modifier keys like control, shift, alt and the Windows key. So here is the script below with some comments: 'Declare the keyboard event Windows API function Declare Function keybd_event Lib "user32.dll" (ByVal vKey As _ Long, bScan As Long, ByVal Flag As Long, ByVal exInfo As Long) As Long 'constant variable for the tab, you can find the constants for other keys here 'https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes Const VK_TAB = &h09 Sub Main 'hold down the tab key keybd_event(VK_TAB,0,0,0) 'press i SendKeys"i" 'then release the tab key keybd_event(VK_TAB,0,2,0) End Sub In terms of sending "Ctrl+Enter" you have got the idea but the constant value for the control key is &h11 (see the link above) otherwise your script is correct. However as Alan points out there are easier ways of sending the control key with another key e.g. SendKeys"^~" The symbols you see above are all depicted in the URL below where you can see a full list of keys that you use with SendKeys: https://www.winwrap.com/web2/basic/#!/ref/WWB-doc_sendkeys_instr.htm You could also do: SendKeys"^{Enter"} Finally if the above is not enough there is yet another even easier way of sending the control key or the shift key or the alt key as a modifier key with another key and that is using the built in commands e.g. "press control india" (you can use press or type) "type shift sierra" "press alt tango" "press Windows key left arrow" (positions your window on the left hand side of the screen) Unfortunately there are no built in commands for using the tab key as a modifier key.
Edit: finally meant to say that Alan used the function SendSystemKeys which uses slightly different key names and also used to be necessary when sending system keys like the control key, however with the latest version of Advanced Scripting (WinWrap basic) SendKeys works just fine. SendSystemKeys is also a bit slower than using SendKeys.
------------------------- |
|
|
|
![]() |
|
Thank you so much, Lindsay. I was able to make a bunch of commands over the weekend and I'm making headway on having this program be more hands-free. I so appreciate Alan and your generosity of knowledge. I'm very grateful for this forum. |
|
|
|
![]() |
|
Okay, now working on creating a command in Asana which would be TAB + Enter. I tried modifying Lindsey's script above but it doesn't seem that I'm able to just substitute the Enter for the "i". When I try to save the command I get a pop-up that says "Could Not Save This Command: A command with the same name and availability already exists. Please, change the commands name or availability." Declare Function keybd_event Lib "user32.dll" (ByVal vKey As _ Long, bScan As Long, ByVal Flag As Long, ByVal exInfo As Long) As Long Const VK_TAB = &h09 Sub Main keybd_event(VK_TAB,0,0,0) SendKeys"Enter" keybd_event(VK_TAB,0,2,0) End Sub
And I get the following error when I try to implement this advanced scripting command:
'#Language "WWB-COM" Option Explicit Sub Main SendKeys "{Tab+Enter}" End Sub
|
|
|
|
![]() |
|
SendKeys "{ENTER}", 1
------------------------- -Edgar |
|
|
|
![]() |
|
Thanks, Edgar. Unfortunately this script does not work in Asana. As I understand it, from Lindsey's quote above, there's something specific about using the tab button in this program. The problem I'm having is that I seemingly can't just substitute Enter for "i" in this format.
"it's not so much that there is anything special about the tab key but the reason that you are using the keybd_event function is that you want to use the tab key as a modifier key meaning you need to simulate holding down the tab key when you press i and then releasing it again, that is something you can't really do with SendKeys other than with the usual modifier keys like control, shift, alt and the Windows key. So here is the script below with some comments:" |
|
|
|
![]() |
|
Declare Function keybd_event Lib "user32.dll" (ByVal vKey As _
Long, bScan As Long, ByVal Flag As Long, ByVal exInfo As Long) As Long
Const VK_TAB = &h09
Sub Main
keybd_event(VK_TAB,0,0,0)
SendKeys"~"
keybd_event(VK_TAB,0,2,0)
End Sub
Remember you can find the key definitions here:
https://www.winwrap.com/web2/basic/#!/ref/WWB-doc_sendkeys_instr.htm
If the above doesn't work then put a Wait 0.1 either side of the SendKeys "~", you can also use SendKeys"{Enter}" instead of SendKeys"~" but please note you must include the curly brackets which you did not do above.
------------------------- |
|
|
|
![]() |
|
Thank you! |
|
|
FuseTalk Standard Edition v4.0 - © 1999-2023 FuseTalk™ Inc. All rights reserved.