Giter Club home page Giter Club logo

osx-script-stuff's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

osx-script-stuff's Issues

Compose automation with Markdown

I saw you were doing some airmail scripting, and I was wondering if you would know how to have applescript click the "Markdown" feature in the compose window. In return I'll share my script that allows me to send a vim buffer to a new email:

#!/bin/bash

# in vim do:  :w !~/airscript.sh

osascript 3<&0 <<'APPLESCRIPT'
on run argv
    set stdin to do shell script "cat 0<&3"
    tell application "Airmail 3" to activate
    tell application "System Events"
        tell process "Airmail 3" to click menu item "New Message" of menu "File" of menu bar 1
        delay .4
		-- Below does not work:
		-- tell process "Airmail 3" to click link "Markdown" of window 1 of window 1
        keystroke tab
        keystroke tab
        keystroke tab
        keystroke tab
        keystroke tab
        keystroke stdin
    end tell
end run
APPLESCRIPT

#osascript 3<&0 airmail.as

Does not work if spaces are in path or file name

Great script, it gave me a good starting point. But I wanted to let you know that it will not work if you have spaces in the file path or the file name.

I couldn't get it to work with spaces in the path names or file names. I'm a AppleScript noob. But here's what I came up with to fix it.

property DOWNLOADS : "/Users/username/Attachments Pre-sort"

on processMessage(theMessage)
	try
		tell application "Airmail 3"
			repeat with anAttach in mail attachments of theMessage
				set aFilename to filename of anAttach
				set aFile to quoted form of aFilename
				set fldr to quoted form of DOWNLOADS
				
				do shell script "cp " & aFile & space & fldr
			end repeat
		end tell
	end try
end processMessage

Save attachments in Airmail

The script only downloads the first attachment and ignores the rest.

Is there any way of changing this behavior? :)

Mail Attachments

I was trying to use your script but it doesn't work in MacOs High Sierra. Do you have a script that works. I am trying to get my PDF attachments to download when the new mail arrives. I have created the rule, just looking for a working AppleScript.

Save attachments in Airmail

Many thanks for this.
In order to work properly, though, the "Download Attachments" checkbox must be set in the account settings.
I wonder if there is a way for the script to instruct Airmail to actually download the attachments, so that this way only the attachments of messages that meet rule criteria were downloaded.

Airmail Save Attachments

SaveAttachment.applescript:

I had to use repeat with anAttach in mail attachments of theMessage (plural) otherwise it didn't work for me (Airmail 3.2.7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.