![]() activate/bring that window to the front (provided it's not minimised) and.get all of its windows and loop over them, and for each:.Given an application identified by a given name.(Also not considered here: other desktops but I can live without that I think.)Ĭould someone point me in the right direction? All help appreciated! Summary where I don't know how to do the bring_window_to_front() part! I guess I need something like this (ignoring, for now, the problem of omitting minimised windows): on run OK, not a bad start, but I want to do this for all VSCode windows (or ideally, all non-minimised ones on currently visible desktops).īTT's AppleScript interface doesn't seem to support targetting particular windows - it just works on whatever app/window is active, so I need to somehow activate/bring to front (?) the window then call the BTT trigger. The effect is that the most recently used VSCode window gets moved. So that activates VSCode, then tells BTT to run a named trigger to move the current window to some position on the screen. Trigger_named "Move window: monitor 4k: core" Tell application "Visual Studio Code" to activate If application "Visual Studio Code" is running then (I've hard coded it here to VSCode, though in the full thing I'm trying to write, it iterates over a list of app names and the triggers to run for them.) on run What I've got working so far is a version which doesn't loop over the windows, so it just hits the "first" one (in some sense of "first", which seems to be "most recently active for this app").įor example, the following works. I'm an experienced programmer but I've never gone deep into AppleScript and find its way of doing things rather weird/confusing. I've tried cargo-culting it but I'm not getting anywhere (other than a suspicion I'll need to involve "System Events"). This feels to me like it should be straightforward, but I don't seem to be able to find the right approach. The job of the named trigger is to move the current window to some location, but the details of that don't matter. I'm trying to write an AppleScript script which (when I boil it down to the simplest version possible) activates some app, and loops over all its windows, triggering a BetterTouchTool "named trigger" for each window. ![]() (This question involves BetterTouchTool but it's not really about that - I think - and I suspect you don't need to know anything about BTT to answer.) ![]() The moving part is handled (by BTT), I just need help with making this happen to all the app's windows. The aim is to move all windows of the app to the same place. I want to write some AppleScript which iterates over an application's (non-minimised) windows and for each of them, brings it to the front and triggers something in another app, BTT (which will move the window).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |