quicksilver / Quicksilver

Quicksilver Project Source
http://qsapp.com
Apache License 2.0
2.73k stars 285 forks source link

Dialog box is treated same as "Application Launched" #2260

Closed D-elias closed 8 years ago

D-elias commented 8 years ago

Under Quicksilver Settings>Triggers>Events>Application Launched, I have an Apple script command to "Maximize Window" with Better Touch Tool. As soon as a dialogue box pops up, the "Application Launched" Event is triggered, constantly moving the dialog box to the top left. The goal of this was to make every Application that is launched open up in full screen but Quicksilver recognizes everything as an "Application Launched" including dialogue boxes. Can you pleas make the "Application Launched" event only get triggered when the Application is launched initially?

skurfer commented 8 years ago

Can you pleas make the "Application Launched" event only get triggered when the Application is launched initially?

Probably not. That notification comes from the OS. I’ve seen problems with it, too. The main reason for the “delay” and “ignore repeats” settings was that the OS would sometimes send 9 “application launched” notifications for one launch.

Having said that, I wasn’t able to reproduce this problem. Which application are you seeing this with? I wonder if the dialogue box is literally handled by another application. A lot app store apps in particular use external helper apps because of sandboxing restrictions.

D-elias commented 8 years ago

I've experienced it with every application that has presented a dialog box. ITunes, photos, forecast bar are a few that come to mind.

Regards, Elias

The soldier died for your freedom, Jesus died for your soul. (Eternal freedom)

On Aug 9, 2016, at 09:10, Rob McBroom notifications@github.com wrote:

Can you pleas make the "Application Launched" event only get triggered when the Application is launched initially?

Probably not. That notification comes from the OS. I’ve seen problems with it, too. The main reason for the “delay” and “ignore repeats” settings was that the OS would sometimes send 9 “application launched” notifications for one launch.

Having said that, I wasn’t able to reproduce this problem. Which application are you seeing this with? I wonder if the dialogue box is literally handled by another application. A lot app store apps in particular use external helper apps because of sandboxing restrictions.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

skurfer commented 8 years ago

Could you please try this to get more information?

  1. Install the Text Manipulation plug-in (if you don’t have it)
  2. Create an empty text file somewhere, like ~/Desktop/launch.log
  3. Create an Event Trigger for Application Launched
  4. Set the trigger to run “Event Trigger Object ⇥ Append With Timestamp To… ⇥ launch.log”

Then go interact with some applications and open some dialogs to see what gets logged to the file?

D-elias commented 8 years ago

I’ve been using the Macintosh like normal for some time now and can not seem to duplicate the dialogue box behavior as long as the “Time stamp” event is in place.

On Aug 9, 2016, at 11:53, Rob McBroom notifications@github.com wrote:

Could you please try this to get more information?

Install the Text Manipulation plug-in (if you don’t have it) Create an empty text file somewhere, like ~/Desktop/launch.log Create an Event Trigger for Application Launched Set the trigger to run “Event Trigger Object ⇥ Append With Timestamp To… ⇥ launch.log” Then go interact with some applications and open some dialogs to see what gets logged to the file?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/quicksilver/Quicksilver/issues/2260#issuecomment-238598484, or mute the thread https://github.com/notifications/unsubscribe-auth/AC5eJXGyLAG6Qp_6uV0UoGmviQS8VgJdks5qeKJ9gaJpZM4Jfb6j.

Regards, Elias

The soldier died for your freedom, Jesus died for your soul. (Eternal freedom)

D-elias commented 8 years ago

I figured out a way to replicate this. When a dialog box is visible in iTunes, after switching to a Mission control space or changing applications and back to iTunes, the “Application Launched” event will trigger each time the application is frontmost. This jumps the dialog box to the top left but does not happen when the command is executed manually. I’ve noticed that the "event trigger" appears to trigger randomly at times even though the application is frontmost.

On Aug 9, 2016, at 11:53, Rob McBroom notifications@github.com wrote:

Could you please try this to get more information?

Install the Text Manipulation plug-in (if you don’t have it) Create an empty text file somewhere, like ~/Desktop/launch.log Create an Event Trigger for Application Launched Set the trigger to run “Event Trigger Object ⇥ Append With Timestamp To… ⇥ launch.log” Then go interact with some applications and open some dialogs to see what gets logged to the file?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/quicksilver/Quicksilver/issues/2260#issuecomment-238598484, or mute the thread https://github.com/notifications/unsubscribe-auth/AC5eJXGyLAG6Qp_6uV0UoGmviQS8VgJdks5qeKJ9gaJpZM4Jfb6j.

Regards, Elias

The soldier died for your freedom, Jesus died for your soul. (Eternal freedom)

skurfer commented 8 years ago

Can you give more specific examples of “dialog box”? In iTunes for example, I hit ⌘U to open a box, then switch to other apps and back, but I don’t see any app launched events.

In the text file where you log things, when you switch to iTunes, does the message show iTunes?

D-elias commented 8 years ago

I was able to get it to do it with trying to delete a playlist to invoke a dialog box warning.

Regards, Elias

The soldier died for your freedom, Jesus died for your soul. (Eternal freedom)

On Aug 9, 2016, at 22:37, Rob McBroom notifications@github.com wrote:

Can you give more specific examples of “dialog box”? In iTunes for example, I hit ⌘U to open a box, then switch to other apps and back, but I don’t see any app launched events.

In the text file where you log things, when you switch to iTunes, does the message show iTunes?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

skurfer commented 8 years ago

Well, it doesn’t sound like the event is getting fired when it shouldn’t. You can confirm with something like https://github.com/kballard/NotificationWatcher

I’ve attached a pre-built copy of that if you want to try it out. (Filter on “launch” and try a few things.)

Notification Watcher.zip

As for why the script is running, I can’t say. Do you have any other Event Triggers? While troubleshooting, I saw a ton of launch events for /usr/bin/osascript. You might try adding that to the “Ignore” panel in the trigger’s preferences.

D-elias commented 8 years ago

I reset all the warnings in iTunes preferences and tapped the delete key on a playlist to invoke a dialogue box. The “Application Launched” event executes an Applescript to key code a shortcut. This shortcut is tied to Better touch tool to “Maximize” the current window. I “unchecked” the boxes to all of the other events except the “Time stamp” and “Maximize window” events and this behavior still continues. The video linked shows the windows maximizing automatically which is the expected result and also the dialogue box behavior. It doesn’t make sense, maximizing the window with a shortcut does not make the dialogue box jump, it only does this when it is automated. This happens randomly so if I can capture it with Notification watcher, how can I send you the log it makes?

https://youtu.be/WxKx-wTHRa4

On Aug 10, 2016, at 13:30, Rob McBroom notifications@github.com wrote:

Well, it doesn’t sound like the event is getting fired when it shouldn’t. You can confirm with something like https://github.com/kballard/NotificationWatcher https://github.com/kballard/NotificationWatcher I’ve attached a pre-built copy of that if you want to try it out. (Filter on “launch” and try a few things.)

Notification Watcher.zip https://github.com/quicksilver/Quicksilver/files/411706/Notification.Watcher.zip As for why the script is running, I can’t say. Do you have any other Event Triggers? While troubleshooting, I saw a ton of launch events for /usr/bin/osascript. You might try adding that to the “Ignore” panel in the trigger’s preferences.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/quicksilver/Quicksilver/issues/2260#issuecomment-238941172, or mute the thread https://github.com/notifications/unsubscribe-auth/AC5eJf9GLHTU4o-Aj4qbFrW710Ai7n40ks5qegqdgaJpZM4Jfb6j.

Regards, Elias

The soldier died for your freedom, Jesus died for your soul. (Eternal freedom)

skurfer commented 8 years ago

I don’t need to see logs. I just thought you could use Notification Watcher to prove that there aren’t actually any “launch” events, and that the behavior is caused by something else.

I’ll also point out that, from what I’ve seen, using AppleScript to “press” keys always leads to unexpected behavior.

Try to separate the different pieces of this workflow to narrow down the cause. For instance, tell the trigger to delay by 5 seconds or something to see of the dialog box jumping is also delayed. Try setting the trigger to do something else obvious (but not involving AppleScripts).

D-elias commented 8 years ago

I created an event that “speaks” the word “test”. Upon switching from iTunes to Finder and back to iTunes again, it speaks the word “Test” two or three times. After removing the Better touch tool piece, I set a delay of 2 seconds and replaced the key code script with the Applescript below as the only event active and relaunched Quicksilver. Switching to iTunes, the dialogue box still jumps to the top left. This happens regardless of enabling it in “selected applications” or “all applications” with or without delay. It still does this after quitting Control Plane and Better Touch Tool. The only time this behavior does not happen is when I disable the event.

-- Maximize frontmost window.

-- AUTHOR: Geoffrey Grosenbach http://peepcode.com -- Works with most setups tell application "Finder" set {screen_left, screen_top, screen_width, screen_height} to bounds of window of desktop end tell -- NOTE This may work better with some multi-monitor setups -- tell application "Safari" -- set screen_width to (do JavaScript "screen.availWidth" in document 1) -- set screen_height to (do JavaScript "screen.availHeight" in document 1) -- end tell tell application "System Events" set myFrontMost to name of first item of (processes whose frontmost is true) end tell try tell application "System Events" tell process myFrontMost set {{w, h}} to size of drawer of window 1 end tell end tell on error set {w, h} to {0, 0} end try tell application "System Events" tell process myFrontMost try set {{w, h}} to size of drawer of window 1 on error set {w, h} to {0, 0} end try set position of window 1 to {0, 0} set size of window 1 to {screen_width - w, screen_height} end tell end tell

On Aug 11, 2016, at 08:48, Rob McBroom notifications@github.com wrote:

I don’t need to see logs. I just thought you could use Notification Watcher to prove that there aren’t actually any “launch” events, and that the behavior is caused by something else.

I’ll also point out that, from what I’ve seen, using AppleScript to “press” keys always leads to unexpected behavior.

Try to separate the different pieces of this workflow to narrow down the cause. For instance, tell the trigger to delay by 5 seconds or something to see of the dialog box jumping is also delayed. Try setting the trigger to do something else obvious (but not involving AppleScripts).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/quicksilver/Quicksilver/issues/2260#issuecomment-239150916, or mute the thread https://github.com/notifications/unsubscribe-auth/AC5eJecZhbg4J_FOHL0MHnUBf8HqL7Ngks5qexoZgaJpZM4Jfb6j.

Regards, Elias

The soldier died for your freedom, Jesus died for your soul. (Eternal freedom)

D-elias commented 8 years ago

That script treats everything as a window including dialogue boxes. The Better Touch Tool way only maximizes the “window” if it indeed is a window except when invoked with QS events.

On Aug 11, 2016, at 08:48, Rob McBroom notifications@github.com wrote:

I don’t need to see logs. I just thought you could use Notification Watcher to prove that there aren’t actually any “launch” events, and that the behavior is caused by something else.

I’ll also point out that, from what I’ve seen, using AppleScript to “press” keys always leads to unexpected behavior.

Try to separate the different pieces of this workflow to narrow down the cause. For instance, tell the trigger to delay by 5 seconds or something to see of the dialog box jumping is also delayed. Try setting the trigger to do something else obvious (but not involving AppleScripts).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/quicksilver/Quicksilver/issues/2260#issuecomment-239150916, or mute the thread https://github.com/notifications/unsubscribe-auth/AC5eJecZhbg4J_FOHL0MHnUBf8HqL7Ngks5qexoZgaJpZM4Jfb6j.

Regards, Elias

The soldier died for your freedom, Jesus died for your soul. (Eternal freedom)

skurfer commented 8 years ago

I created an event that “speaks” the word “test”.

Via AppleScript, or using Quicksilver’s “Speak Text (Say)” action? I tried it using the action and other than what I assume are tons of osascript launches in the background, I don’t get anything unexpected.

D-elias commented 8 years ago

I made a Quicksilver’s “Speak Text (Say)” action to say test on “Application Launched” and it spoke it more than once when I switched to iTunes. I found a paid application to maximize windows and tried to automate every new window to be fully maximized upon initial launch. I created an “Application Launched” event with Quicksilver to key the SizeUp fullscreen shortcut and it works for the most part but is glitchy with Finder windows invoked to fullscreen repeatedly and not letting me move them and issues with the info panes being invoked repeatedly a few times a second. There are no issues with user apps, only Finder and “get info” panes.

http://www.irradiatedsoftware.com/sizeup/ http://www.irradiatedsoftware.com/sizeup/

On Aug 11, 2016, at 20:43, Rob McBroom notifications@github.com wrote:

I created an event that “speaks” the word “test”.

Via AppleScript, or using Quicksilver’s “Speak Text (Say)” action? I tried it using the action and other than what I assume are tons of osascript launches in the background, I don’t get anything unexpected.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/quicksilver/Quicksilver/issues/2260#issuecomment-239334595, or mute the thread https://github.com/notifications/unsubscribe-auth/AC5eJZxge0iPqQ5DbBNn0UKshP93_3Rrks5qe8GkgaJpZM4Jfb6j.

Regards, Elias

The soldier died for your freedom, Jesus died for your soul. (Eternal freedom)

skurfer commented 8 years ago

I made a Quicksilver’s “Speak Text (Say)” action to say test on “Application Launched” and it spoke it more than once when I switched to iTunes.

But when the trigger was logging to a file, you didn’t see it more than once?

D-elias commented 8 years ago

I think I finally figured out what is going on with this. After creating an event to log files with an “Application launched” trigger and going to a Safari window for one minute, I noticed that the Default Folder X process triggered it 3 times even though I didn’t touch the trackpad. The issues are caused by the “Application Launched” trigger listening for process’s and not just Applications launched. It is literally trying to “Enter Fullscreen” every time a process changes. Since I have so many things running in the background, this explains why in the Sizeup application, it says that I moved 3000 windows in only a few days.

Safari and back and a few minutes time. 8/16/16, 23:55 /Applications/Default Folder X.app/Contents/Resources/DXFinderWindowServer 8/16/16, 23:57 /Library/Little Snitch/Little Snitch Software Update.app 8/16/16, 23:58 /Applications/Default Folder X.app/Contents/Resources/DXFinderWindowServer 8/16/16, 23:58 /Applications/Utilities/Console.app 8/16/16, 23:58 /Applications/Default Folder X.app/Contents/Resources/DXFinderWindowServer 8/16/16, 23:58 /Applications/Default Folder X.app/Contents/Resources/DXFinderWindowServer 8/17/16, 00:01 /Applications/Default Folder X.app/Contents/Resources/DXFinderWindowServer 8/17/16, 00:01 /Applications/Default Folder X.app/Contents/Resources/DXFinderWindowServer 8/17/16, 00:01 /Applications/Default Folder X.app/Contents/Resources/DXFinderWindowServer 8/17/16, 00:02 /Library/Little Snitch/Little Snitch Software Update.app

On Aug 16, 2016, at 13:13, Rob McBroom notifications@github.com wrote:

I made a Quicksilver’s “Speak Text (Say)” action to say test on “Application Launched” and it spoke it more than once when I switched to iTunes.

But when the trigger was logging to a file, you didn’t see it more than once?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/quicksilver/Quicksilver/issues/2260#issuecomment-240171182, or mute the thread https://github.com/notifications/unsubscribe-auth/AC5eJfcsktqd9F5GAnaYDuAK3Qo73GOPks5qge-9gaJpZM4Jfb6j.

Regards, Elias

The soldier died for your freedom, Jesus died for your soul. (Eternal freedom)

skurfer commented 8 years ago

Have you tried adding those things to the “Ignore Items” list on the trigger?

D-elias commented 8 years ago

I know how to get the posix path two applications but I'm not sure how to get the process identifier for Quicksilver to isolate each process individually.

Regards, Elias

The soldier died for your freedom, Jesus died for your soul. (Eternal freedom)

On Aug 17, 2016, at 09:16, Rob McBroom notifications@github.com wrote:

Have you tried adding those things to the “Ignore Items” list on the trigger?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

skurfer commented 8 years ago

It should be ignoring and matching based on the identifier, which in the case of files is just the path. You probably won’t find those in your catalog, but if you paste the path into Quicksilver then hit ⎋, you should be able to drag the resulting object to the ignore list.

skurfer commented 8 years ago

In any case, it sounds like Quicksilver isn’t doing anything wrong, so I’ll close this for now. Feel free to ask follow-up questions.

D-elias commented 8 years ago

Thanks for the help. It does seem to fix it. I’m having an issue with a process still triggering even though I added it to the “disable in selected applications” list. It triggers this many times: /Applications/Default Folder X.app/Contents/Resources/DXFinderWindowServer

I added this individually and together: Default Folder X DXFinderWindowServer /Applications/Default Folder X.app/Contents/Resources/DXFinderWindowServer

Any ideas why this is ignored and the other process’s are respected?

On Aug 19, 2016, at 09:22, Rob McBroom notifications@github.com wrote:

Closed #2260 https://github.com/quicksilver/Quicksilver/issues/2260.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/quicksilver/Quicksilver/issues/2260#event-761257662, or mute the thread https://github.com/notifications/unsubscribe-auth/AC5eJS3cTweDD6rLCzlBMgFX8OYGIY1sks5qha4mgaJpZM4Jfb6j.

Regards, Elias

The soldier died for your freedom, Jesus died for your soul. (Eternal freedom)

skurfer commented 8 years ago

Any ideas why this is ignored and the other process’s are respected?

No. The answer is surely in this test, but without the same setup, I can’t really debug it.