kerrydawson Posted May 10, 2013 Share Posted May 10, 2013 I want to quit all my applications first and then restart the computer. I have the feeling the two commands are happening concurrently rather than consecutively. How would I construct this workflow to accomplish the above. Link to comment
jdfwarrior Posted May 11, 2013 Share Posted May 11, 2013 I want to quit all my applications first and then restart the computer. I have the feeling the two commands are happening concurrently rather than consecutively. How would I construct this workflow to accomplish the above. Connect a Run Script output to the back end up Quit All Applications and set the language to osascript then enter the code.. tell application "System Events" tell process "Finder" click menu item "Shut Down" of menu "Apple" of menu bar 1 end tell end tell I didn't try the AppleScript but it's the same code I used for the Restart command before. Link to comment
kerrydawson Posted May 11, 2013 Author Share Posted May 11, 2013 Connect a Run Script output to the back end up Quit All Applications and set the language to osascript then enter the code.. tell application "System Events" tell process "Finder" click menu item "Shut Down" of menu "Apple" of menu bar 1 end tell end tell I didn't try the AppleScript but it's the same code I used for the Restart command before. Thanks David Another quick question as I'm totally baffled by this one. I have two Applescripts I'd like to combine so that the first does what it does and tells mail to send my email from ksdawson tell application "Mail" to make new outgoing message with properties {sender:"<ksdawson@icloud.com>", visible:true} This works perfectly Now I have another Applescript that creates a new mail message to sign the mail Kerry Dawson tell application "Mail" activate set theMsg to make new outgoing message with properties {visible:true} set message signature of theMsg to signature "Kerry Dawson" end tell Do you have any idea how to get the one mail message to send from ksdawson as in the first Applescript and combine the second so that it also signs it Kerry Dawson This would save me from constantly having to choose these items I just can't figure out how to put these together just to create the one mail item with the id and signature Link to comment
kerrydawson Posted May 11, 2013 Author Share Posted May 11, 2013 Connect a Run Script output to the back end up Quit All Applications and set the language to osascript then enter the code.. tell application "System Events" tell process "Finder" click menu item "Shut Down" of menu "Apple" of menu bar 1 end tell end tell I didn't try the AppleScript but it's the same code I used for the Restart command before. David - that worked like a charm. Alfred quickly closed down all my running apps and restarted the computer. Thanks Link to comment
jdfwarrior Posted May 12, 2013 Share Posted May 12, 2013 Thanks David Another quick question as I'm totally baffled by this one. I have two Applescripts I'd like to combine so that the first does what it does and tells mail to send my email from ksdawson tell application "Mail" to make new outgoing message with properties {sender:"<ksdawson@icloud.com>", visible:true} This works perfectly Now I have another Applescript that creates a new mail message to sign the mail Kerry Dawson tell application "Mail" activate set theMsg to make new outgoing message with properties {visible:true} set message signature of theMsg to signature "Kerry Dawson" end tell Do you have any idea how to get the one mail message to send from ksdawson as in the first Applescript and combine the second so that it also signs it Kerry Dawson This would save me from constantly having to choose these items I just can't figure out how to put these together just to create the one mail item with the id and signature This should work.. tell application "Mail" activate set theMsg to make new outgoing message with properties {sender:"<ksdawson@icloud.com>", visible:true} set the message signature of theMsg to signature "Kerry Dawson" end tell Link to comment
kerrydawson Posted May 12, 2013 Author Share Posted May 12, 2013 This should work.. tell application "Mail" activate set theMsg to make new outgoing message with properties {sender:"<ksdawson@icloud.com>", visible:true} set the message signature of theMsg to signature "Kerry Dawson" end tell David, I'm sorry I missed this message for some reason. I wish I had seen it. With a lot of horsing around I came up with exactly the same thing: on alfred_script(q) tell application "Mail" activate set theMsg to make new outgoing message with properties {sender:"<ksXXXXXX@icloud.com>", visible:true} set message signature of theMsg to signature "Kerry Dawson" end tell end alfred_script I created another Alfred workflow in the same workflow with exactly the above but I changed it to my other ID and its signature. So I have the above Alfred emb for email business and emp for email personal. They both work great. Thanks for your help. I told you I'm not a scripter LOL! I've got my Applescript book out AppleScript 1-2-3 and its no Lotus 1-2-3. Its over 800 pages. It describes itself as "A self-paced guide to learning Applescript". Yeah well my pace is I might get through it in ten years - NOT. I actually want to convert these Applescripts so that they take say a reply email and possibly change the outgoing ID and signature. So they won't have to create a new message but act on the existing message. I think I might figure that one out. I just keep playing around by pulling this out and that and Applescript says nope so I put it all back together and look at what seems logical and try again. In your above scenario I somehow accidentally hit it LOL! Yes, I wish I had seen this response sooner but I did create my first AppleScript and then put it in Alfred and it worked and then I put it in Keyboard Maestro and it worked. I can see some things are faster in the way they happen if you do use Applescript. One thing I'm finding about Alfred is its giving me tons of ideas I hadn't thought about before. I am using it all the time now. I haven't gone crazy but I love saying "Alfred" log me into the Royal bank and I type Alfred 1p Royal and I'm there. However, I then began thinking how does Alfred do this and so doing a Google search I found out from Agilebits support site how to do this directly for 1Password and now can do this in a variety of ways. This is what I mean about Alfred is making me think about things I wouldn't normally think about doing. Howevever, I have to remain a good GTDr and keep focused on what I really do. One of those things I haven't done in a few days is write an article LOL! I should have my next one done today. Its a toughie and i've been procrastinating on this one for a while but I'm pretty well done. However, I kind of like to kind of distract myself with well what else can I get Alfred to do for me . 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