Jump to content


  • Posts

  • Joined

  • Last visited

Contact Methods

  • Twitter
  • Website URL

Profile Information

  • Location
    New York, NY
  • Interests
    Biophysics. Python. Macs. Running.

mlgill's Achievements

Helping Hand

Helping Hand (3/5)



  1. Good to know--I've been looking for this too and couldn't figure out where it went. Thanks!
  2. Here's the applescript snippet that will get you most of the way there: on alfred_script(theFilePath) set theFile to theFilePath as POSIX file tell application "Mail" -- get a list of all mail message windows set theMessageList to every outgoing message -- either select the front most mail window or create one if none exist if length of theMessageList is greater than 0 then set theMessage to item 1 of theMessageList else set theMessage to make new outgoing message with properties {visible:true} end if -- add the file to the message tell content of theMessage make new attachment with properties {file name:theFile as alias} at after last paragraph end tell end tell end alfred_script I hooked this up after a file action and it will either append a file to an existing message or create a new message with the file if no messages exist. The applescript currently doesn't take multiple files, but you could modify it to do so by parsing the resulting tab-delimited string from the file action. One issue I can't figure out (and don't have time) is that when I run this within the applescript editor, it will correctly append a second or third attachment to an existing message. In Alfred, it seems to replace the existing attachment. Hope this gets you on your way, though.
  3. Just deleted my current version, downloaded the git version via a zip file from Safari, and reinstalled. Tried a bunch of examples and they all worked fine for me.
  4. Glad it worked for you, Bethany! I wrote lots of comments and extracted more data from the note than you may want since I figured it might help you learn. I do have one comment about automatically quitting notes once the note was created. If you use notes on your phone or another computer, you will want to make sure the application has time to sync the note to iCloud. This happens very quickly in my experience, but it may not be instantaneous. So it might be wise to insert a time delay before quitting notes. The code to do this is very simple: delay 5 where the number afterwards is the delay in seconds. I've guessed, but 5 seconds should almost certainly be enough. You can also enter fractions, so delay 0.5 would be half a second. Enjoy!
  5. Hi Bethany, Nice workflow! To get a notification, you have to return a string of some kind from the "alfred_script" subroutine. I'm no Applescript wizard myself, but I think I can help. Here's a sample applescript that will query Notes.app to see if the note was created and then return information about it. I've made lots of comments so hopefully it's relatively clear. on alfred_script(q) tell application "Notes" set theNoteID to make new note in folder "Notes" with properties {name:"From Alfred", body:q} end tell -- this function will check for the note and retun a string with some information from it set theResultOfNoteQuery to my verify_note(theNoteID) -- next return the string from this script to alfred return theResultOfNoteQuery end alfred_script on verify_note(theNoteID) try tell application "Notes" -- get references for the properties of the note and the list that contains it set theNoteProperties to properties of theNoteID set theListProperties to properties of container of theNoteID -- get some of the properties of interest from the note and from the list set theTitle to the name of theNoteProperties set theText to the body of theNoteProperties set theCreationDate to the creation date of theNoteProperties set theListName to the name of theListProperties end tell -- shorten the main text of the note so it fits in the notification -- can adjust this via the integer for "maxStringLength" set maxStringLength to 15 if the length of theText > maxStringLength then set theShortText to (items 1 thru maxStringLength of theText as string) & ".." else set theShortText to theText end if -- put this together to make a string with note info -- this joins some variables with text -- the backslashes before some of the double quotes are so that these double quotes are part of the text that is shown -- this can be customized if you want to change the notification -- this is a detailed version of the string to be returned -- it has currently been commented out so it is not used --set theSuccessString to "Created note with title \"" & theTitle & "\" on list \"" & theListName & "\" on " & theCreationDate & " with text \"" & theShortText & "\"." -- this is a shorter version set theSuccessString to "Created note with text \"" & theShortText & "\"." on error -- if the "try" function fails, it likely means the note does not exist set theSuccessString to "There was an error creating the note." end try -- send this back to the main alfred function return theSuccessString end verify_note It sounds like you know this, but after the "Run Applescript" block in the workflow, you then also have to add a block to "Post Notification" within that block, add {query} to the "Text:" field and customize anything else. This notification block has to be connected to the backend of your "Run Applescript" blocks. Hope this helps.
  6. I created the above before seeing this one which is *way* better http://www.alfredforum.com/topic/173-cloudapp-workflow/
  7. Good idea. Done. I've also moved the workflow to github so the download link will always stay the same: https://github.com/mlgill/alfred-workflow-create-reminder Because the previous two Cloud.app links contained Applescripts with bugs in them, I've deleted them. The link in this post should be the default from now on.
  8. Just saw this. Way better than the one I made.
  9. This works fine for me. This was a bug in the time handling which has hopefully been corrected in this workflow http://cl.ly/0j3d3U1Y000x and in the link above on Github.
  10. Awesome. I'll look into using this to fix my Cloud.app uploader workflow so the password isn't stored in plain text anymore.
  11. A workflow to upload a bookmark or file(s) to Cloud.app and return the link to the clipboard. Note that you must enter your Cloud.app username and password in the beginning of the file "alfred_cloudupload.py". The URL for a bookmark should be pasted into Alfred. Single files or directories can be selected via the file filter or multiple files can be selected in Finder as a file action. Multiple files and directories are always zipped before uploading. You can optionally zip every file (even single files) via a switch in the script. http://cl.ly/071P1A3a3z3D I should add that putting your password in plain text inside this or any workflow (there are others that do this) is always a risk. I, personally, don't store anything that important in Cloud, so I'm not that worried about it. Caveat emptor.
  12. Here's a workflow that utilizes an Applescript I wrote to parse a text input and create a reminder in Reminders.app http://cl.ly/3D2p051e002M Here's the original Applescript on Github if you wish to copy/modify for your own uses https://gist.github.com/3813222 (The Applescript will work in LaunchBar too.)
  13. You're of course welcome to edit the workflow in any way you wish, but I don't see any point in copying the expanded url to the clipboard since the unexpanded one is already there and will accomplish the same thing if pasted into a browser. I considered adding an option to open the URL in the default browser but there's no way in Alfred to decide if opening the URL is the desired action after previewing the expanded link. For my usage, automatically opening the URL in a browser defeats the purpose of previewing the expanded link.
  14. Here's a workflow to shorten a pasted URL using goo.gl. Inspired by the Google search that allows alternation between Safari and Chrome, I also added the option to preview an already shortened URL using Notification Center if alt is pressed. http://cl.ly/0y3b3g1y2f07 This mostly builds on existing workflows, but thought I'd post since I don't believe the Goo.gl script has yet been ported from version 1. Enjoy.
  • Create New...