Jump to content

Recommended Posts

Hi,

 

i'm using the template "launch file group from keyword" to start all my necessary apps for work. Is there a way to close these apps with a keyword too?

 

many thanks

 

How customizable are you wanting this to be because, using the system commands, Alfred has the ability to quit applications using the Quit keyword, or the Quitall keyword. These are available under the System section in the Alfred Preferences

Link to comment

Do an applescript with a quit to that application. For example: To close the Chrome browser:

 

on alfred_script(q)

   tell application "Google Chrome.app"

       quit

   end tell

end alfred_script

 

You don’t actually need on alfred_script(q), here. You can compress everything to one line, by doing tell application "Google Chrome" to quit, which will do the same, and will be more readable/maintainable, when doing it to multiple apps.

However, I agree with David that using the builtin quit might be simpler, depending of course how how much control you need out of this.

Link to comment
  • 3 months later...

Hello!

 

I'm a totally newbie in that field and would like to have a workflow to close a defined group of apps. But I don't even get it to work with one app!

I tried it with the example above and thought I might just repeat the lines for the apps I want to get closed:

 

 

Do an applescript with a quit to that application. For example: To close the Chrome browser:

 

on alfred_script(q)
   tell application "Google Chrome.app"
       quit
   end tell
end alfred_script

 

 

I made a blank workflow, added a hotkey as trigger, then action > Run NSApplescript and pasted the script in there. But Chrome is not closing at all. :(

What am I doing wrong?

 

Thanks in advance!

Link to comment

Hello!

 

I'm a totally newbie in that field and would like to have a workflow to close a defined group of apps. But I don't even get it to work with one app!

I tried it with the example above and thought I might just repeat the lines for the apps I want to get closed:

 

 

I made a blank workflow, added a hotkey as trigger, then action > Run NSApplescript and pasted the script in there. But Chrome is not closing at all. :(

What am I doing wrong?

 

Thanks in advance!

 

Code should be:

tell application "Google Chrome" to quit

Shouldn't be "Google Chrome.app", just "Google Chrome". You specify the app name not the file name 

Link to comment
  • 2 years later...
On 7/6/2013 at 4:24 AM, Rookie79 said:

Hi,

 

i'm using the template "launch file group from keyword" to start all my necessary apps for work. Is there a way to close these apps with a keyword too?

 

many thanks

 

 

What does that workflow look like for you? I have a few different web templates (rails, express, javascript, ember) that I'd like to be able to open as a scaffold for new projects via workflow. And it sounds like I could do something like that.

 

ideally, it would go something like on keyword template with argument rails or express etc it would open the corresponding template directory in atom, maybe even throw in a git init too. Looks like just opening the files on command is easy enough.

 

Link to comment
1 hour ago, Benjamski said:

 

What does that workflow look like for you? I have a few different web templates (rails, express, javascript, ember) that I'd like to be able to open as a scaffold for new projects via workflow. And it sounds like I could do something like that.

 

ideally, it would go something like on keyword template with argument rails or express etc it would open the corresponding template directory in atom, maybe even throw in a git init too. Looks like just opening the files on command is easy enough.

 

 

Sounds like a List Filter would be a good fit for that (assuming you're using Alfred 3).

Link to comment
  • 1 month later...

I'm creating a Keyword workflow to close all of my Adobe applications. I used this and got it mostly working:

 

Quote

Do an applescript with a quit to that application. For example: To close the Chrome browser:

 

on alfred_script(q)
   tell application "Google Chrome.app"
       quit
   end tell
end alfred_script

 

My problem is that if Photoshop is not open when I run the workflow, it launches first, then closes. Is there a way to prevent this so if the application is not open, it is just ignored? This doesn't seem to happen with Illustrator, InDesign, or a few others but I haven't tested all of them.

Link to comment
35 minutes ago, ScubaSteve said:

My problem is that if Photoshop is not open when I run the workflow, it launches first, then closes. Is there a way to prevent this so if the application is not open, it is just ignored? This doesn't seem to happen with Illustrator, InDesign, or a few others but I haven't tested all of them.

 

The fact it doesn’t happen with all apps is a clue that the issue likely lies with the application is does happen on, in which case you’ll have to contact the developers of said app. All that said, this might work:

if application "Google Chrome" is running then
  tell application "Google Chrome" to quit
end if

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...