I'm not a programmer, first off. So forgive my ignorance here. I am trying to disable bluetooth using applescript. My goal is to assign this applescript to my Griffin Powermate button to make it easier to use with my iMac as a second screen for my MBP. I have this script, which gets it most of the way, but the problem is in mavericks, if you click the button to turn off bluetooth, you get another window that needs you to confirm that you want to do that. It comes in the form of two buttons, one that says "Turn bluetooth off" and the other that says "Leave bluetooth on".
So I can't for the life of me figure out how to get the script to click the button in the secondary window (like a popup, but it's not modal)
Thoughts?
Here's the current script I have, which works great to turn bluetooth back on, by the way, because there is no secondary window.
tell application "System Preferences"
reveal pane "com.apple.preferences.Bluetooth"
end tell
tell application "System Events" to tell process "System Preferences"
click button 6 of window 1
end tell
quit application "System Preferences"
I can't test it, because I get another sheet, but this should work:
tell application "System Events" to tell process "System Preferences"
click button 6 of window 1
click button "Turn bluetooth off" of sheet 1 of window 1
end tell
Related
I'm using Tauri and would like to change the menu items shown when clicking my application in the taskbar using the right mouse button (Windows/Linux) or double click (MacOS).
For example Firefox shows "Open a New Window" and music players often show "Play/Pause" or "Next track" buttons. How to do that with Tauri?
I'm aware of SystemTrayMenu in Tauri, but that only seems to affect the system tray, not the task bar.
(What I mean by "taskbar": the line of application icons that you click to open them, and that usually indicate which ones are running. I think MacOS calls it Dock, in Windows it's at the bottom between start button and clock, and Linux isn't very homogeneous but in Ubuntu it's vertically on the left by default. I do not mean the system tray of usually smaller icons that are almost always next to the clock, that are usually more like background services. I.e. I mean where your browser usually shown up, not where your VPN usually shows up.)
Tauri does not support this at the moment (2022-06-27). You may file a feature request.
I've been trying to use the IDE without resorting to a mouse and I've been quite successful so far. Except when the IDE identifies an internal problem and a red button blinks at the bottom right of the IDE. And then I need to use the mouse to click there and get to the "IDE Fatal Errors" dialog, so I can submit the bug report.
How can I get there without using a mouse?
PS: I'm on windows
Windows get focus is meaning that you can type in something in that. But at the same time, I hope that windows not to cover some others. How to config gnome 3 to implement that?
Leaving a window in focus though not on top of the screen is quite easy in Gnome. It is possible to give each and every window a special attribut which will shift their priority on the screen.
First, right click the titlebar of the application which should always be on top. A small menu should pop up. Now just select the option "Always on top" and you are done. This option may be parsed to multiple windows. Independently of which window is in focus, the application with this attribute will always cover it.
By the way the so called "Titlebar Actions" can be configured through the gnome-tweak-tool. Under the "Windows" tab you may define what should happen on a double click, a middle click or a secondary/right-mouse click.
I want to view on the Linux console two dialog windows on the same time
one window that view the progress BAR
and the second tailbox that view the logs are running.
The problem is that the dialog present in the central of the console
What I want is to view the two dialog boxes on the same time on the console while the progress BAR is on the top of the screen
and the tail BOX should present down in the screen.
How to implement this?
How to place the dialog window up or down and not in the center ?
dialog --title "RUN TASKS FROM TEXT TABLE" --gauge "Please wait..." 10 70 0
dialog --tailbox file.log 10 100
You might be able to get this to work, using --tailboxbg, followed by --and-widget and then --gauge. The positioning of the widgets is straightforward, using the --begin option. The complication is in handling input from the keyboard: dialog makes a special case for allowing multiple -tailboxbg options by polling input across the corresponding windows. That polling "works" for similar widgets (which have input), but --gauge does not use input from the keyboard.
I am trying to write an applescript on OSX 7 that simply opens the "Edit Serial Ports" option in the Bluetooth Preferences Menu (I only have one paired device). I was able to get all the way to the bluetooth preferences pane, but I am stuck on how to tell applescript to select the appropriate option from the drop down menu. Would anyone be able to help me with this?
The applescript so far:
tell application "System Preferences"
activate
end tell
tell application "System Preferences"
activate
set current pane to pane "com.apple.preferences.Bluetooth"
end tell
Thank you so much for sharing your knowledge and expertise!
I was able to answer my own question, and learned a lot about applescript and xcode in the process. The correct script is as follows:
tell application "System Preferences"
set current pane to pane id "com.apple.preferences.bluetooth"
tell application "System Events"
tell process "System Preferences"
click menu button "Perform tasks with the selected device" of splitter group 1 of group 1 of window "Bluetooth"
delay 1 -- give menu time to pop up
click menu item "Edit Serial Ports…" of menu 1 of menu button "Perform tasks with the selected device" of splitter group 1 of group 1 of window "Bluetooth"
delay 5
end tell
end tell
quit
end tell