eriksatie Posted April 15, 2015 Share Posted April 15, 2015 Hi, I'm totally new to Alfred and to workflows. and also to scripting I bought Alfred to create shortcuts for setting some simple "work environments". that means to close unused apps, open needed apps, documents and webpages. It should be easy! I've done some experiment and I've successfully created a workflow with a trigger and two actions. the first action is an Apple script that quite some applications: on alfred_script(q) tell application "Safari" to quit tell application "Google Chrome" to quit tell application "Mail" to quit tell application "Contacts" to quit tell application "Calendar" to quit tell application "Evernote" to quit tell application "Reminders" to quit tell application "Safari" to quit tell application "Notes" to quit tell application "Finder" to quit end alfred_script the second is an Open Url Action that open a web page on Chrome. The idea is to close all unused tabs on Chrome and open just the ones I need. now the problem is that I'm not able to tell Alfred that as first it should execute the Apple Script, and after that it should reopen Chrome and load the web page. Any advice on this? Yuri 1 Link to comment
eriksatie Posted April 15, 2015 Author Share Posted April 15, 2015 Also, I don't want to really quit finder, I just would like to close all finder windows. is there a command for this? thankyou Link to comment
RodgerWW Posted April 15, 2015 Share Posted April 15, 2015 the applescript to close all finder windows tell application "Finder" to close every window I'm not familiar with Chrome, but you should be able to close all tabs and at the end of the script just load the URL you want into Chrome Link to comment
eriksatie Posted April 15, 2015 Author Share Posted April 15, 2015 RodgerWW, thankyou for the answer. I understand that I don't have to use a workflow action to load the URL, instead I have to use a line in the script to load it. but how do I load URL in the script? then, where i can find which commands I have to use in Applescript to interact with Chrome (or any other software)? can you point me to some beginner resource to apple scripting? thank you Link to comment
dfay Posted April 16, 2015 Share Posted April 16, 2015 This is not a bad starting point: http://computers.tutsplus.com/tutorials/the-ultimate-beginners-guide-to-applescript--mac-3436 The key thing to learn from it is how to read an Applescript Dictionary. Once you can do that, you can figure what aspects of an app can be scripted. eriksatie 1 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