Alan He Posted June 6, 2020 Share Posted June 6, 2020 I currently have a requirement that my script data rely on first dispatch key combo I can only do that before this script But the disadvantage of this is that I have to ask the user to enter a keyword blue and press Enter to display the script data item. I also want display script item directly. and any method to implement it? ## Want to be I want user keyword blue,I dispatch key combo, and display script item, does not need enter bt again. Link to comment
vitor Posted June 6, 2020 Share Posted June 6, 2020 This looks like an XY problem. Please explain what you want to achieve in the end, not how to reach the method you have in your head. Also, when asking for help with a Workflow, please upload it somewhere (transfer.sh is a fast solution without ads; drop your Workflow in the box in the middle) as we can’t properly help you without access to it. Link to comment
Alan He Posted June 6, 2020 Author Share Posted June 6, 2020 (edited) Sorry, my description is not clear. OK, I will describe it again. My problem is that when I want to execute a script filter, I want to execute the dispatch key combo first. because there is a system hotkey command that will perform a file write operation. I need to read this file in the script filter. any method to do it? Edited June 6, 2020 by Alan He Link to comment
vitor Posted June 6, 2020 Share Posted June 6, 2020 Instead of simulating the Key Combo, why don’t you call the write operation from a Run Script beforehand—or better yet, in the Script Filter`—instead? Key Combos are asynchronous, they won’t way for the result of whatever they called before carrying on. If you must use a Key Combo and the issue is the write isn’t happening fast enough, add a Delay Utility. But you really should go with the first suggestion, if at all possible. Link to comment
Alan He Posted June 6, 2020 Author Share Posted June 6, 2020 (edited) Because of this write operation, I can only do it with hammerspoon. I need it to read the battery info of the Bluetooth device of the system.hammerspoon can do it, So I disapath hammerspoon to write info , In Alfred, I want to display the information. Edited June 6, 2020 by Alan He Link to comment
vitor Posted June 6, 2020 Share Posted June 6, 2020 3 hours ago, Alan He said: I need it to read the battery info of the Bluetooth device of the system.hammerspoon can do it So can plenty of other tools, including ones that ship with the system. But as I said, to do it how you’re doing it, add a delay so it has time to save the file before trying to read it. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now