Update to Automatically Encrypting PDF with PDFPen via AppleScript and Hazel

I wasn't really happy with the security piece in the original simple script for encrypting PDFs and there isn't any scripting for keychain access anymore in Mountain Lion.  So I googled it and came up with a link that had a sample / demo script I could adapt at MacScripter.net.   To work, you need to store your selected password for your PDF's in the KeyChain (name in KeyChain should be inserted for PDFName and should be an application password.  It uses a built in 'security' command in OSX as explained by partron22 at MacScripter.net.  It will ask you for access to the KeyChain when the script executes and you can decide whether you want to grant access one-time or always.

The script (text at bottom) has has been set up to run in Hazel.  Hope this helps folks.

 Script in Hazel Script in Hazel [/caption]

set this_file to theFile -- use this if you are using hazel 

set label to "PDFName" --this is the Name: in Keychain change for whatever you use
set Qlabel to quoted form of label
set t to do shell script "security 2>&1 find-generic-password -gl " & Qlabel
set text item delimiters to "\"" -- Get Password
set tlst to every text item of t
set pw to item 2 of tlst

tell application "PDFpen"
open this_file
save document 1 encrypt using AES256 password pw
end tell

Automatically Encrypting PDF's via PDFPen in Filing WorkFlow

see updated script using Apple's KeyChain....better security

I'm still using Yojimbo but I'm contemplating switching to simple nested folders for filing my documents.  One piece I want to maintain is some security on the documents.  So I did a short script to automatically open and encrypt a PDF document in PDF Pen.  

Since the password is embedded in your script, I don't think its the most secure but should the documents end up somewhere else, they'll be secure.   The script is at the bottom. 

 Hazel workflow with encrypting PDFPen Hazel workflow with encrypting PDFPen

 Script from the testing phase if you don't use hazel. Script from the testing phase if you don’t use hazel. [/caption]

script is below for embedding in Hazel

set this_file to theFile
set pass_word to "password"

tell application "PDFpen"
open this_file
save document 1 encrypt using AES256 password pass_word

end tell

Embedded Powerpoints in Mac 2011 - Tip to View Easily

AAArgh I Can't View This PowerPoint Before the Meeting

I've used this tip more than a few time over the last month so I thought others may be interested. If you work in a mixed PC - Mac Workplace where the information is shared primarily by MS Office, you've probably run into this issue: A coworker sends a summary document in MS Word document outlining a recommendation or project plan and inside are embedded MS Word, Excel, and PowerPoint supporting files. You could ask your busy colleague to send the original. You may be pressed for time say that, unfortunately, the meeting is tomorrow early AM with your counterparts in Asia and Europe.

Word and Excel documents are OK as they will launch. PowerPoint and PDFs won't. You can run Office for Windows in a VM like parallels and that can save the day. If you don't want to spend more of your companies money, you can extract the file out of the word document very easily.

I found this tip buried somewhere in a response to someone asking this question for a PDF. Either it's not a big problem or every one knows this tip. Nonetheless, someone will find this a big help!

I've been doing this with .docx files. I re-save the original in this format if it is an older word format.

Tip For Viewing Embedded Powerpoints

  • make a copy of the file so you don't lose the original
  • change the File extension to .zip
  • double-click the .zip file and you'll get an extracted folder
  • open this folder: inside the word folder is a Embeddings folder
  • your powerpoint will be in here with a generic name.pptx

If its a PDF file, it will be in the embeddings folder but named as a .bin file. Simply rename it to .PDF

  <img src="http://ctm2.micro.blog/uploads/2019/abac65b81e.jpg" alt=""/>

Payoff from Paperless - So Much Win

So I put the vast majority of items in our file drawers into PDF's via a ScanSnap 1500M (Thanks for the reco MPU - you know MacSparky and Katie Floyd ).  One of our big appliances just acted up.  I have the PDF's of our files in Yojimbo and was quickly able to access the manual (I had downloaded this vs. scanned) and go to the trouble shooting section AND find a receipt with the phone number to the service company.  Total time was about 45 secs. of searching.  Got the model number serial number...you name it, I found it.

So much win!!!!

More on iPad Notetaking

The times I need my iPad for note-taking are when my computer is being used for presenting of slides.  The iPad work flow generalizations I talked about in this post seem to be holding.  I practiced taking notes during a few smaller one to one meetings before having a meeting last week where my work computer was in use as the presentation machine. I tapped out the note in markdown in Textastic. For the most part, the stumbles were on the bullets and formatting like indenting.  Without a keyboard, it is tougher to keep up with key points. 

When the meeting was finished, t was about 5 minutes for some gross edits and then I simply open the text file in the Box.net App and uploaded to my nvALT directory, previewed in nvALT, copied, and pasted into a reply to the meeting invite. 

I was able to then type a quick cover on the sent email to a couple of the higher ups to let them know the status and when to expect an update. 

The last piece to the flow wasn't needed as I passed off the follow-ups to a colleague.  The sent email will get captured in OmniFocus with a due date for resend to prompt status updates from the team at the appropriate date. 

A Bit More on iPad WorkFlow

So I have more than a few text editors on the iPad.  So I revisited a couple to further work on my iPad workflow and meet my IT requirements.  Net is this seems to work.

Box.net using Open In to get it to Textastic ( the editor I tried today) and away we go. 

Open In from Textastic back to the Box app and its back to the server.  Delete from device and its clean as a whistle.  

The cut and paste from the Markdown preview into iOS mail is nice.  All in all, the only thing holding this up is touch typing.  I can't keep up in a large meeting without being able to touch type. 

More on iPad Note Taking Work Flow

I just read a good post from Jeff Hunsberger of Technology Notes Nebulous Notes iPad Workflow. There are a couple of good insights one can glean from this article beyond the direct tips on a good flow. One is clearly that Text Expander can be a valuable tool to reduce the friction of taking notes by setting up your outlines. Jeff points to the macro keys on Nebulous Notes as a great way to leverage this.

For me the next bit comes from trying out both nebulous notes and other note taking Apps combined with all the information I have been reading on the web. That is the portability of a process and indeed the output from that process, the markdown text file, should be as portable as possible. With this in mind, I still prefer a full size keyboard an nvALT for the least amount of friction. I can now get text bits off the iPad into my Mac and get the Markdown output into email looking good and out to people quickly.

It can be generalized as:

  • text editor that has open in feature
  • Box app linked to my work account (Box is the only cloud service I can use for work)

Friction Reducers are:

  • Text expander support
  • special programmable keys or Markdown specific keys

A couple of thoughts regarding the use of the Open Infeature. I've just realized through the difficulty of linking my Box.net work account that use single sign on (SSO) within apps is often confusing to me as there are two ways to link things up. SSO and an external password set up on Box.net. A final consideration is security. Do I really want my work Box account accessed by multiple apps? Not really. Therefore, I've gone to the workflow of Open In. I keep the Text bits in my nvALT folder on box.net and out of my apps on my iPad.

For home, meaning this blog mainly, Dropbox is fine and works great with many apps.

On the reverse trip, from nvALT to the iPad, the Box app has an open in feature to get the text to the app. I don't use this feature much.

The last friction point is typing on the screen which is a not smooth enough for really making this work flow function enough to meet my needs.

So nvALT to outlook remains the preferred route.

Meeting Notes Work Flow in that ends in Microsoft Outlook for the Mac

I’ve had a lot of problems getting a workflow that allows me to efficiently get meeting notes out to the meeting participants. The requirements are that I end in the body of a Microsoft Outlook 2011 message to send to the folks that attended. The reason is that in our company, like most others these days, are busy enough that opening an attachment is enough friction to stop folks from reading the notes. This work process is when I am running the meeting and the meeting notes are to confirm Next Actions / Owners / Timing as well as for my ability to follow-up.

The Challenges:

  • I cannot hook my iPad up to the company network to easily transfer files.?
  • Box.net is the approved cloud service. Dropbox is not allowed.
  • I am back to back most days in meetings and don’t have much time to work the meeting notes.
Here’s what I’ve tried:
  • iPad hand written in Notability or NoteTaker HD - transcribe into email. This was far too much rework. We’re not allowed to hook our personal devices like our iPad’s to the company network so there is friction getting the notes off of the iPad and back to my work Mac. I don’t type fast enough on the iPad to keep up during the meeting.Does not work for me. This workflow failed miserably. I often failed to send out the notes rapidly enough to be effective.
  • Circus Ponies Notebook - This was effective for capturing outlines but the translation into Outlook was horrible. I used this program as an archive for my files and meeting notes for almost a year but ultimately, the inability to easily spotlight search the files effectively (I had embedded the files in the notebooks) became a deal breaker. I still have to go back to these notebooks to find information and its not easy enough.
  • Omni-Outliner - also effective for note taking but translation into Outlook was wonky. There were some strange formatting issues and I spent a lot of time reformatting. Having to export to RTF or .doc was another source of friction.
  • Outlook - this was passable but taking notes was a bit rougher than I would like.
Currently, I’m using nvAlt to take notes using simple markdown. I’ve set the default fonts in the markdown preview to the same that I use in Outlook and simply copy the notes from the preview into Outlook. I am only about 2 weeks into this but its much better than the other work flows. How do I know its helping. The only meeting notes I’ve failed to issue were when I was running presentations and couldn’t take notes at the same time. The iPad to Outlook friction pops up at that point. Clearly, I need a text editor on the iPad that syncs with Box.net and I should solve that end.

  <img src="http://ctm2.micro.blog/uploads/2019/1c6ac02686.jpg" alt=""/>

  <img src="http://ctm2.micro.blog/uploads/2019/0bad7a0bb0.jpg" alt=""/>

An add to the Macsparky OmniFocus Hazel Rule

This post at Macsparky is great from a workflow standpoint to make sure the bill gets paid. I've tweaked to add the id of the file from Yojimbo so I can call up the bill.? You can spotlight search the id and get to the bill. I'm sure a link to the file could be set up this way but I don't have it yet.

The script adapted from Macsparky.com post:?

set theDate to current date

set theTask to "Pay Bill"

tell application "Yojimbo"

set theLink to id of last pdf archive item of the library

end tell

set theNote to "Scanned or downloaded on " & (theDate as string) & " " & theLink

tell application "OmniFocus"

tell front document

set theContext to first flattened context where its name = "Home"

set theProject to first flattened project where its name = "Bills"

tell theProject to make new task with properties {name:theTask, note:theNote, context:theContext}

end tell

end tell


Hazel to Yojimbo including Encrypting File

First off, you'll get a lot of great content form macsparky.com.   So check over there for really good tips.  The Mac Power Users podcast got me much more functional on the whole productivity in a Mac world so check that out as well.

This post is about getting an Applescript to use in Hazel to drop items into Yojimbo including encrypting and OpenMeta tags.  I programmed as a kid (Basic on C64, Commodore Pet,...) but have little experience on the Mac side since getting an iMac a couple years ago.

First, why Yojimbo and not simple file/folder?  I use Yojimbo because I like the ability to encrypt certain documents (like Bank Statements) and still have the documents searchable in spotlight.     The other solution was an encrypted disk image but it was only searchable after the image was mounted with the password.  The watch-out for using a program to organize your files is having to get them out later or the upgrade path being locked in.  Its easy to grab all items and drag them out of Yojimbo to a folder where I'm guessing I could cobble together some hazel rules to sort them out via the open meta tags or simple title and content rules like used to dump them into Yojimbo.

Versions of Programs:  Hazel (version 3.0.12), Yojimbo (version 3.0.4 (260)), AppleScript Editor (version 2.5 (138)) - you don't really need Applescript Editor but I used it to test out how to make this work.

This seems like it should be trivially easy but I always had a problem until I added a line in the front: set this_file to theFile.  I'm not sure why.  So here is the script.  The encryption piece was relatively easy simply using the last PDF archive item.

   [caption id="" align="alignnone" width="517.0"]<img src="http://ctm2.micro.blog/uploads/2019/5426d21e78.jpg" alt=" AppleScript to embed in Hazel for import and encrypt in Yojimbo "/>  AppleScript to embed in Hazel for import and encrypt in Yojimbo [/caption] 

   [caption id="" align="alignnone" width="668.0"]<img src="http://ctm2.micro.blog/uploads/2019/9e78c89a77.jpg" alt=" Hazel rule where the AppleScript is embedded "/>  Hazel rule where the AppleScript is embedded [/caption] 

And the script:

set this_file to theFile

tell application "Yojimbo"

import this_file

encrypt last pdf archive item of the library

end tell

A Start

I ran a blog at work for about a year about 6 years ago focused mainly on scientific literature awareness.  However, I've never done a serious bit outside of work.  This is the start.