Rookie79 Posted July 6, 2013 Share Posted July 6, 2013 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 Link to comment
raguay.customct Posted July 6, 2013 Share Posted July 6, 2013 (edited) 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 Edited July 6, 2013 by raguay.customct Link to comment
jdfwarrior Posted July 6, 2013 Share Posted July 6, 2013 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 Rookie79 1 Link to comment
vitor Posted July 7, 2013 Share Posted July 7, 2013 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
Rookie79 Posted July 7, 2013 Author Share Posted July 7, 2013 quitall That´s too easy and solves my issue. Link to comment
raguay.customct Posted July 8, 2013 Share Posted July 8, 2013 I did not know the quit and quitall keywords. There is so much in Alfred that everyday is a day learning new things! That's just part of the fun! Link to comment
Heidern Posted October 25, 2013 Share Posted October 25, 2013 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
jdfwarrior Posted October 25, 2013 Share Posted October 25, 2013 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
Heidern Posted October 25, 2013 Share Posted October 25, 2013 Thanks! Now I just need to repeat this line and add my apps. Link to comment
Benjamski Posted October 6, 2016 Share Posted October 6, 2016 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
deanishe Posted October 6, 2016 Share Posted October 6, 2016 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
ScubaSteve Posted November 17, 2016 Share Posted November 17, 2016 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
vitor Posted November 17, 2016 Share Posted November 17, 2016 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now