Jump to content

Recommended Posts

Windows switcher

 

Description

The workflow can be used to switch between the many windows in the current desktop.

It's really easy to use, you can switch to a specific named window using the keyword swin <name of the process or name of the window>.

Then a list with the following informations about the results will appear:

  1. Process
  2. Application name

 

When you open one result, by pressing Enter on it, the selected window should be opened.

In real the workflow opens all the windows of the process, but it puts in foreground just the selected window.

With the ⌥ modifier all the windows belonging to an other processes will be hidden.

----------------------------------------------

State

Author Emanuele Munafò

Version 1.1

Last release 02/08/2016

Email ema.muna95@gmail.com

Compatibility: Alfred v3 ( or higher)

                        Alfred 2 NOT supported

----------------------------------------------

Changelog and update

  • v1.1

    Now the results are filtered by both the name of the window and the name of the process. [02/08/2016] 
    Thanks to: Jean-Claude Jung

  • First release [01/08/2016]

----------------------------------------------

Screenshots

3owyoRnzVTFv3P2NKo.gif

3owyoSnN8G4wvAm1lS.gif

 

----------------------------------------------

Download

Click here to download from Packal

 

----------------------------------------------

Bug

You can contact me here or by email if there is something wrong with the workflow.

I had never programmed with Applescript until now, so be kindly if the structure of the script is not so good.

Known:

  1. All the windows of the process will be opened, not the best way.
  2. If a process has many windows in different desktop some issues can be revealed.

----------------------------------------------

Todo

  1. Open just the selected window.
  2. Add caching system for icon path/appname (It should improve the performance of about 1 sec)
Edited by emamuna
Fixed typo (Packet → Packal)

Share this post


Link to post

 

Windows switcher

 

Description

The workflow can be used to switch between the many windows in the current desktop.

 

 

What a nice workflow!

 

ottimo lavoro, Emanuele!

 

I have just a comment, if I can make a suggestion:

 

I did try to remove the code that finds the item icons, and indeed all the stuff seems to be "snappier" and a lot faster, especially with a lot of windows opened.

 

So I think it could be possible to:

 

1) have the workflow contain and assign directly the icons for common processes ( finder, mail, safari, etc )

 

2) for less common processes, cache the results so only one icon search would be performed if more than one window is opened

 

I think is a good good workflow for everyday use, gaining something in terms of speed would maker it perfect!

 

thanks for doing and sharing it,

 

     Giulio

Share this post


Link to post

Yes, I know. I already thought about this, answering another user who was disappointed by the performance. Here the log:

 

 

I think an easy caching, simple as caching just icon and app name, should improve performance.
In the attachment a workflow that can be called with the swinn keyword that use always same icon and doesn't get the app name.
The performance boost seems noticeable (testing with the script editor the last script execute in 0sec, while the first needs 2 secs.)
Note that this value is just an approximated integer, so I can't have a real difference but seems that should be more then 1 sec.
Ofc a cached script will use some more cycles. I think it needs a try!

But I also told him that I'll do that when I will have some free time. I already started my studies for the university for the next exam, so I don't know when I'll update it.

But thank you for your feedback, it is welcome!

Let me know if you have more suggestion!

 

PS: In the link below there is the script I did for the people who needs better performance now and can't wait the update.

https://mega.nz/#!nA0ASTiY!CvGQpZPCbCITGf7aM4BudDIB6ljWrkuCWMiTpjBq1Kc

attive by keyword swinn with double n (Change it if you want ofc)

Share this post


Link to post

Hey man nice work, i wish i knew about your workflow before creating mine, it does somewhat the same thing. I think if we combine them together we can make a really good workflow. I see that you only work with processes but mine also detects non scriptable apps and reopens them, it does have some issues but i think a combination of code can fix a-lot of issues and make a pretty dynamic workflow.

 

Check out mine, you might find the code a bit messy as i am not an apple dev and just trying to get into it!

 

https://github.com/SteliosHa/Alfred_QuitFocus-Mgr

Share this post


Link to post

Hey man nice work, i wish i knew about your workflow before creating mine, it does somewhat the same thing. I think if we combine them together we can make a really good workflow. I see that you only work with processes but mine also detects non scriptable apps and reopens them, it does have some issues but i think a combination of code can fix a-lot of issues and make a pretty dynamic workflow.

 

Check out mine, you might find the code a bit messy as i am not an apple dev and just trying to get into it!

 

https://github.com/SteliosHa/Alfred_QuitFocus-Mgr

 

Nice,

In real I have no time until 13 September  because I have an exam tomorrow and another on that date.

After that I thought about rewriting my script in python adding caching and maybe other features.

Your workflow could be useful, thank you.

If you have further question about code, feel free to contact me by mail! (speaking here about the code could create confusion inside the topic)

Share this post


Link to post

 

Not having success.  I'll type 'swin' and nothing happens.

 

 

I'm sorry for that, can you provide more information about your system? (OS X version, Alfred version, debug output)

In the meanwhile you can try two different script:

Click here to download from Packal  keyword to use: swin

and the different version here (with keyword swinnhttps://mega.nz/#!nA...rkuCWMiTpjBq1Kc

Read the previous message to understand the difference between the two version of the workflow.

Emanuele

Share this post


Link to post

Alfred 2 was NOT tested. (but i think it should work too)

 

 That's a no-go, I'm afraid. If you built the workflow with Alfred 3, it will not work in Alfred 2. It doesn't matter whether it uses 3-only features or not, unfortunately.

 

After that I thought about rewriting my script in python adding caching and maybe other features.

 

If you do, there's my Python library, which has decent caching smarts built in (it's fundamentally designed around using cached data for speed while updating the cache in the background).

 

It can also take care of other tedious crap like updating the workflow, and the fuzzy search would be a great fit for your workflow.

Share this post


Link to post

 

 That's a no-go, I'm afraid. If you built the workflow with Alfred 3, it will not work in Alfred 2. It doesn't matter whether it uses 3-only features or not, unfortunately.

 

 

If you do, there's my Python library, which has decent caching smarts built in (it's fundamentally designed around using cached data for speed while updating the cache in the background).

 

It can also take care of other tedious crap like updating the workflow, and the fuzzy search would be a great fit for your workflow.

 

Thank you danish both for your answer about v2 compatibility and for the great work you did with alfred-workflow.

I'll use your (wonderful) python library for sure, as I did for every workflow I wrote (except this one ofc!)

As regards the caching system, I don't know if I could use the built-in method in your library , because I want to cache just the process name with the ico-path related to that application.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...