Hi,
I searched the forum, but maybe did not get my searchstring right.
I am looking for an elegant way to post the result of a fastkeys input selection box into an AHK command or script.
What I am trying to achive is, I want to have a shortcut that creates an Outlook Task for me but gives me a selection of strings that describe the task for the subject
With Best Regards,
André
Input Select Form into AHK Command
Hi, great question, I'm glad you asked.
There are different ways to do this. One way is to use Insert Another Item macro. Another convenient way in your case would be to use Insert Command Code macro. Variables from Input or selection forms can be used in a script.
For example, create type Send item with the following substitute (use a More menu to create macro fields):
where the inserted code would be for example:
You can use any AutoHotkey syntax. The same principle applies to Selection fields, just use the proper variable names (SELECT_VariableName).
There are different ways to do this. One way is to use Insert Another Item macro. Another convenient way in your case would be to use Insert Command Code macro. Variables from Input or selection forms can be used in a script.
For example, create type Send item with the following substitute (use a More menu to create macro fields):
Code: Select all
%INPUT_MyInput%
%CODE_MsgBox%
Code: Select all
MsgBox % INPUT_MyInput
Hi Marko,
thank you for your reply.
I tried it but did not get it to work.
Here is what i did:
1) Createt a New ShortCut Element
2) Inserted %SELECT_task_type% Selection field with two Options
3) Inserted %CODE_createNewTask% which is
When I trigger the shortcut I receive the following error:
"Error 0x8001010D - A outgoing request can not be executed because the application sends an input-syncronized request"
I tried several things but could not find the reason myself.
Please help.
With Best Regards,
André
thank you for your reply.
I tried it but did not get it to work.
Here is what i did:
1) Createt a New ShortCut Element
2) Inserted %SELECT_task_type% Selection field with two Options
3) Inserted %CODE_createNewTask% which is
Code: Select all
Application := ComObjActive("Outlook.Application")
;example of creating a MailItem and setting it's format to HTML
olTaskItem := 3
TaskItem := ComObjActive("Outlook.Application").CreateItem(olTaskItem)
TaskItem.Subject := %SELECT_task_type%
TaskItem.Display
"Error 0x8001010D - A outgoing request can not be executed because the application sends an input-syncronized request"
I tried several things but could not find the reason myself.
Please help.
With Best Regards,
André
Andre, I see a Com within the inserted code causes a conflict. I will check what might be the reason. The other issue with my first answer is that when using selection forms, the resulting text is always sent, which you don't want.
Could you use this alternative (Type Command)?:
Could you use this alternative (Type Command)?:
Code: Select all
Menu Mail, Add
Menu Mail, DeleteAll
Menu Mail, Add, Subject One, MMail
Menu Mail, Add, Subject Two, MMail
Menu Mail, Add, Subject Three, MMail
Menu Mail, Add, Subject One, MMail
Menu Mail, Show
return
MMail:
Application := ComObjActive("Outlook.Application")
;example of creating a MailItem and setting it's format to HTML
olTaskItem := 3
TaskItem := ComObjActive("Outlook.Application").CreateItem(olTaskItem)
TaskItem.Subject := A_ThisMenuItem
TaskItem.Display
return