I want to combine message menu and message button in my slack app.This is the workflow I am trying to achieve.
1) User fires a slack slash command to display the menu. This menu will have one dropdown and three buttons. This I am able to achieve.
2) I want user to select an option from dropdown and press any of the action button.Then only the action should be triggered
Problem is that when i select any option from dropdown, it triggers the action. I do not want the action to be triggered this way. I just want the action to be triggered after clicking on the button
What you are asking is not possible with Slack. Clicking an option in an interactive menu will always issue an action.
Instead I would suggest to implement the workflow in two steps. First show the buttons and then the menu (or other way around).
https://api.slack.com/docs/message-menus
You can mix message buttons and message menus within the same message by including multiple attachments
Related
I have been trying to figure this out for a few days now and still cannot understand how this works.
I have created a new AppleScript Project in Xcode version 13.4.1 and added a CheckBox and a Button. My goal is to try and so something depending on whether the CheckBox is Ticked or Un-Ticked.
I am extremely new to Xcode so I am most likely doing something wrong.
The reason for not showing real code is that I have nothing that works so I am asking if anyone can help me learn this by filling in the missing gaps.
The documentation for Xcode Applescript object seems thin on the ground to me or at least that's what I am finding.
Thank you
property checkBox : 1 -- bound to the value of the check box & is ticked when run
#START BUTTON
on startButtonClick_(sender)
-- if checkbox is ticked then show alert "ticked"
-- if checkbox is NOT ticked then show alert "NOT ticked"
end startButtonClick_
Update
It was suggested that including real code would be more useful which I do agree with so here is the latest attempt I have tried.
property checkBox : missing value -- bound to the value of the check box
#START BUTTON
on startButtonClick_(sender)
set checkBox to (checkBox as boolean) -- toggle
if checkBox is 1 then display alert "Ticked"
log checkBox
end startButtonClick_
The alert never shows but yet the log output shows 1 when the checkbox is ticked and 0 when its unticked when I press the button
There are two issues here, depending on exactly what you're trying to do.
If you are trying to connect the checkbox action so that it calls a handler when you click on the checkbox, follow this procedure:
Make a handler in your script (in your case, the startButtonClick_(sender) handler)
Open the xib file, select the First Responder object on the left
Go to the Attributes pane in the Inspectors area. You'll see a
box labeled 'User Defined', so click the '+' button to add a new
user defined action.
Use the name of your handler with a colon, not an underscore, e.g.: startButtonClick:
Set the 'type' to NSButton (or I suppose you can use the default 'id')
Select the File's Owner object in IB, go to the Connections Inspector, and make sure the AppDlegate is connected as the File Owners delegate.
It should be, but I tripped over that problem during testing, so...
Select the button-in-question in IB
Go to the Connections Inspector, and control-drag from the Sent Actions area to the First Responder, selecting your user-defined action (which should now appear in the popup menu).
Now when you run the app and click the checkbox, it will run the hander with a reference to the checkbox as its argument. You can query that using sender's state() to get the current value of the button.
If you want a static, global reference to the button so you can check its state anywhere in the script, you may run into a problem. In Xcode 12 and earlier script properties would appear as outlets in the AppDelegate popup menu, so that you could connect GUI elements graphically. Xcode 13 has an as yet unresolved bug that makes this impossible, but you can work around it to an extent by editing the xib xml directly. Ive detailed how to do that in this post.
Hope this helps.
I am creating a vb.net program in visual studio 2019 community. I have created a form with several buttons and group boxes. Within the group boxes are radio buttons and or Check boxes. The form also uses 2 custom controls. 4 instances of Custom control "A" is on the form at design time. Two instances of Custom control "B" are added at runtime and more can be added by the user with a button click. Note that custom control "B" has within it 4 instances of custom control "A".
The problem is when I run the program and press the tab key I do not get the expected behavior of focus moving to the next control. Nothing happens when tab is pressed. Pressing the tab key does nothing regardless of which control I give focus to.
I have set tab stop to true on all the controls I want to stop on. I have set the tab index values in the order I want.
Thinking maybe it has something to do with the custom controls...
I tried removing the code that adds custom control "B" at runtime so that no custom control "B" is on the form. That did not help.
In addition to removing control B I disabled all Custom control A. That did not help either.
Is there a setting somewhere that enables the tab button to work as expected?
What else should I be looking at?
Ok so this appears to be unrelated to the form. I failed to mention this is an add in for another program (Autodesk Inventor). I also failed to consider that inventor may be handling the tab key, which appears to be the case...
https://adndevblog.typepad.com/manufacturing/2012/05/handling-tab-key-in-inventor-net-forms.html
i have an issue trying to disable the event place_changed from an autocomplete on blur, as soon as i type, the list pop-ups and you can navigate with the arrows through the list, if i click an option, it fires place_changed, that works fine, but if i navigate through the options with the arrow keys, and left one option with focus, if i simple click outside without selecting, it does fire place_changed too...
That behavior isn't what i want, cause i feel anyone will find clicking outside as,ignoring whatever you were doing, like... "Hey, i didnt select the options, i just navigated through them"
I'm trying to imitate a feature of Windows. For example, when you're in a folder's properties, and then open the 'Advanced' popup from the properties page; if you try to click out of it the menubar flashes and a windows error sound is made. It is not until you close the popup by pressing okay or cancel or X that you can continue.
I would like to imitate this feature in my VB.NET project, thinking there would be an easy enough way to do this, but I cannot find one.
Show the second form as Dialog from the first form. While the second form is still open, user can't interact with the first form.
using vs2010 installer, I have added a dialog box with two checkboxes, I want the "Next"button to be active only if either of the check boxes are selected. is that possible at all?
It should be possible, as in the case with common radio button pattern where you have to select “I agree” to move to the next screen. You can try to implement something similar. Yet you may need to introduce some custom actions because MSI does not re-evaluate control conditions right away.
The simplest solution would be to check whether one of them or both are checked when user clicks Next. In general your UI should have the most common defaults and should allow users to click through the installer.