Jump to content
kerrydawson

I want to quit my apps first and then Restart

Recommended Posts

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.

Share this post


Link to post

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.

Share this post


Link to post

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

Share this post


Link to post

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

Share this post


Link to post

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

Share this post


Link to post

 

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 :).

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...