Using your university’s free Apple Developer account to eliminate the “Unknown Developer” Error in your 3rd-party-developed macOS App

If you work for a university and have developed a macOS app (as a part of your academic job) using 3rd party software (e.g. a Java app developed with Eclipse and built with Gradle), you’re probably familiar with telling your users how to deal with the annoying “Unidentified Developer” error they get when they double-click your app:

negcontrol.png

They get a window saying “<your app> can’t be opened because it is from an unidentified developer“.  The user is given no clear option on how to run the app except a vague reference to “security preferences”.

There are things the user can do to get around this error without you becoming an “identified developer”.  A user can perform a one-time bypass by right-clicking the app and selecting open or they can muck around with their Security & Privacy System Preferences settings.  They can even execute some commands in the Terminal to reveal a setting that has been hidden in the past few versions of macOS to always allow apps from anywhere.  But what would be nicer is to eliminate this error so that the user doesn’t have to do any of that.  Normally that involves giving Apple money to pay for membership in their developer program, but if you’re in academia, Apple has free such accounts for “Educational Institutions”.

Chances are, your university has already enrolled in this program and all you have to do is hook into that resource.  But be aware that universities have an image to uphold and that digital identity extends into the App Store, so they’re not likely to welcome any app to sit alongside their custom campus, reunions, and transit apps.  You can belay their fears about your app by noting that you intend to distribute your app outside of the App Store.  Users who download your app won’t even ever see the university’s name unless you added it to your app yourself.  All you need is a certificate that will allow you to code-sign your app so that Apple can know who you are.

It took me awhile to navigate this system.  I initially ran off on this tangent trying to create a free “education” Apple Developer account by digging up and supplying my University’s D-U-N-S number, official address, etc… and ran into a form that asked me to assert that I could commit the university to legally binding agreements, at which point I realized that I was on the wrong path.  Free educational institution Apple Developer accounts aren’t per person, faculty, or department.  They’re 1 per university.  I already had a couple of official university apps on my iPhone, so I knew there already existed an account, and made a number of calls before I got put in touch with the Apple Developer Account “holder”.

Those in charge of the Apple Developer Account here were only familiar with iOS app development, so they didn’t know how to advise me on accomplishing what I wanted to accomplish.  My sole goal was to eliminate the “Unidentified Developer” error.  No-one knew whether that meant I had to distribute my app on the app store or what, and they were of course concerned about the app showing up alongside all their campus-centric apps.  I managed to convince them that I wouldn’t be distributing on the app store and that I believed all I needed was a code-signing certificate.  Since no-one here knew how to do that, I called Apple again.

Apple really pushes their developers into Apple’s canned development resources (XCode) to do their development.  In fact, even their developer support team members tend not to know anything about code-signing and certificates, because it’s all handled in the background behind XCode.  I had numerous phone calls with Apple Developer Support and they proclaimed that it sounded like I was “speaking a different language”.  They weren’t even familiar with the “Unidentified Developer” error and immediately referred me to the makers of the 3rd party development apps I was using, implying it was a problem with their software.  I persisted however, because I had already tried code-signing using apple’s codesign command line utility and managed to get them to at least confirm that what I suspected was happening was happening.  And that is, that not any certificate will do… but I’m getting ahead of myself.

Here, I will walk you through, in detail, the steps I took to eliminate the error from my latest app (TreeView3)…

How to distribute an academic (e.g. “scientific”) macOS app outside the app store

Purpose

To eliminate the “Unidentified Developer” error when users try to run our app downloaded from a third party repository (e.g. BitBucket or github)

Requirements

  • Gradle (and the macAppBundle plugin)
  • You are employed by an educational institution
  • A Mac computer
  • An Apple ID
  • A personal Apple Developer ID (obtained using your Apple ID from here)
  • Apple’s Developer Tools (In Terminal.app, run `xcode-select –install`)
  • Contact info of your university’s Apple Developer account holder (either the team agent or a team admin).  If your university hasn’t enrolled in the Apple Developer Program, someone who can bind the university to legal agreements must start the process here (selecting “Accredited Educational Institution” under “Entity Type”)

Desired Result

  1. Distribution of your .app distributed inside a .dmg, outside of Apple’s App Store
  2. No “Unidentified Developer” error when a user downloads & runs your app
  3. Your app will not impact your university’s campus-centric digital identity on the App Store

Overview

  1. Setup
  2. Development Testing
  3. Obtaining a Production Level Certificate
  4. Production Testing

Scope

  1. These instructions assume you have finished your app development and are ready to distribute
  2. These instructions assume you are building a working app using Gradle and the macAppBundle plugin
  3. The only topic covered in this article is how to eliminate the “Unidentified Developer” error from an otherwise fully working Java app, though the information contained may be useful in other contexts

How-To Procedure

  1. Setup

    1. Confirm that you have obtained a personal Apple Developer ID mentioned in the requirements above and have identified your academic institution’s point-of-contact for their Apple Developer Account
    2. Contact your University’s Apple Developer Account holder (an Admin or the account Agent) and request to be added to the team as a “member” (the lowest privilege access level) and supply them with your Apple ID so that they can email you an invitation
    3. The invitation you receive will look something like this: appledevinvite.pngClick the invitation link and respond to the invite within 30 days.
  2. We’re going to start off by generating a “Mac Development” certificate in order to test that our code-signing procedure is correctly configured before attempting to use a production certificate, which will involve the time of the team agent:

    1. Log into your Apple Developer account and do the following:

      1. Click “Certificates, Identifiers & Profiles”: certsidsprofs.png
      2. Select “macOS” from the drop-down menu at the top left:macoscerts.png
      3. Under “Certificates”, click “All”: certsall.png
      4. Click the “+” at the top right:pluscert.png
      5. Click the “Mac Development” radio button and “Continue”, leaving this window open:macdevreq.png
    2. Now we switch to an app on all macs called “Keychain Access.app”.  Just do a Spotlight search to find it.  We’re going to use it to create a “Certificate Signing Request” (CRS, for short)

      1. Select Keychain Access > Certificate Assistant > Request a Certificate from a Certificate Authority:csrmenu.png
      2. Enter your: university email, full name, & saved to disk (leaving “ca email” empty) & click continue
      3. Select a memorable place to save the CSR file & click done
    3. We need to submit our CSR to Apple, so let’s return to the window we left open above (in step 4.1.5) and do the following:

      1. Click continue to indicate we’re ready to upload our CSR
      2. Upload the saved CSR file & click continue on the following page
      3. Click download to retrieve your development certificate and then done
      4. You can move the certificate (ending with .cer) from the downloads folder to a safe place so you don’t lose track of it
    4. Install the Mac Development (.cer file) certificate

      1. Double-click the .cer file.  It will open in Keychain Access.app.
      2. When prompted, select the login keychain (or whichever keychain you prefer) and click add.
      3. Find the certificate in Keychain Access.app.  Narrow your search by clicking on the “Certificates” category.  Your certificate will be named something like this: “Mac Developer: <your name> (<certificate-ID-string>)”.  There should be a triangle next to it that when expanded reveals a private key that Keychain Access created upon installation.  If the key is not there, it dod not install correctly, possibly because the .cer file wasn’t created by you or downloaded from your own Apple Developer account.
      4. Double-click the certificate named “Mac Developer: <your name> (<certificate-ID-string>)” and copy the user ID/certificate-ID-string.  I’ll refer to this as the “cert string” here-on-out.
    5. Now let’s add the cert string to your application build process.  Open your build.gradle script and make the following edits:

      1. Add `certIdentity = “cert string“` to your macAppBundle block, where “cert string” is a string of random characters that looks something like “Z4XE107A5H”.
      2. Then add `createDmg.dependsOn(codeSign)` underneath/outside the macAppBundle block (so that `gradle createDmg` will execute the code-sign).  The final code snippet might look something like this:gradleexample.png
    6. Test your certificate with a new gradle build

      1. cd into your project directory (where your build.gradle script is)
      2. Execute gradle createDmg
  3. Obtain a “Developer ID Application” certificate.


    At this point, if everything worked (i.e. the build above succeeded and there’s a message in the verbose output that says “:codeSign” without an error following it) and you’re ready to release your app, you must obtain a “Developer ID Application” certificate, install it, and replace the cert string with that of the new certificate. This is specifically for distributing your app outside of the mac app store *and* if you’re not creating an installer, but rather a .app inside a dmg.  The following steps may be slightly inaccurate or incomplete, because I did not witness this process, but had emailed the steps to our team agent who followed them…

    1. Request your university’s Apple Developer team agent to create a certificate of type “Developer ID Application”.  (Note: an admin cannot create a certificate of this type.)  This entails the following steps:

      1. Log into the Apple Developer “agentaccount and do the following:
        1. Click “Certificates, Identifiers & Profiles”
        2. Select “macOS” from the drop-down menu at the top left
        3. Under “Certificates”, click “All”
        4. Click the “+” at the top right
        5. Click the “Developer ID Application” radio button:c_create_developer_id_certificate.png
        6. Click continue (and leave this window open, to return to it later)
      2. In the Keychain Access app:
        1. Select Keychain Access > Certificate Assistant > Request a Certificate from a Certificate Authority
        2. Enter your: university email, full name, & saved to disk (leaving “ca email” empty) & click continue
        3. Save the CSR file in a memorable place & click done
      3. Go back to your apple developer account where you left off and:
        1. Click continue to indicate you’re ready to upload your CSR
        2. Upload the CSR file and click continue on the following page
        3. Click download to obtain the certificate and then click done.
        4. Select a memorable place to save the .cer file
      4. Double-click the certificate in the Finder (which opens in Keychain Access) and do the following:
        1. Select the login keychain & click add
        2. In the Keychain Access window that opens up, click the “Certificates” category to find the cert, which should be named something like “Developer ID Application: <team name> (<cert-ID-string>)”
        3. Expand the certificate by clicking the gray triangle next to it and highlight both the “Developer ID Application…” row and the next row, which is the “team agent name” private key
        4. While both rows are highlighted, right click and select “Export 2 items” in order to share them with the team member who requested them
        5. You will be saving a p12 file to your machine, and you will need to create a password for it in order to share the file (you will need to share the password as well), so note it down
        6. Email both the P12 file and the password to your team member (who does not have to be an admin or agent – just “team member”)
    2. Once you receive the certificate (and private key) in the form of a .p12 file via email, install it by doing the following:

      1. Save the cert/key (.p12 file) in a memorable place
      2. Double-click the p12 file in the Finder (which opens in Keychain Access.app)
      3. Select the login keychain & click add
      4. Click the “Certificates” category to find the cert as before, but this time it will be named like “Developer ID Application: <team name> (<cert-ID-string>)”, and ensure that you can reveal your personal private key with your name on it underneath the certificate.
      5. Double-click the certificate and copy the user ID
    3. Return to your build.gradle script and replace the cert string from your Mac Development certificate with the one you copied in the previous step, then save the file.

    4. Test your certificate with a new gradle build

      1. cd into your project directory (where your build.gradle script is)
      2. Execute gradle createDmg
    5. Test your new code-signed app

      1. Make sure the security & Privacy settings in your System Preferences are set to allow apps installed from known developers
        1. Open System Preferences
        2. Click “Security & Privacy”
        3. Click the lock in the lower left corner (if locked) and enter your system password
        4. Under “Allow apps downloaded from”, select “App Store and Identified Developers”
        5. Click the lock and close the window
      2. Try to provoke an “Unidentified Developer” error
        1. Upload your dmg to bitbucket or whichever repository you intend to distribute your app from
        2. Re-download the dmg from your repository
        3. Double-click the newly downloaded dmg
        4. Drag the app to your Applications folder
        5. Double-click your app
        6. If the app opens without an unidentified developer error, it worked! Note, you will still get a warning that the app was downloaded from the internet, but will be prompted with an open button.openedfrominternet.png Apple’s gotta have some way to get 3rd party app developers to pay-up, after all.

Acknowledgements

This article is an updated variation of devreboot’s “Distributing an app on Mac OS X without Xcode, outside the Mac App Store“.  If you’re not using Gradle, there are some relevant tidbits about doing the signing yourself on the command line in there.  Without devreboot’s article, I would have had a very hard time figuring out what to do.

The macAppBundle gradle plugin only has information on the codesign ability in one of the issues pages, which is a good resource if you’re having trouble with it.

I had had a hard time figuring out which certificate I actually needed.  There are a number of them and I had a couple false-starts, but then I found this article on stack overflow that had some great info.

Without this article by Jonathan Franchell, I’d have been stuck scratching my head as to why an emailed certificate was not working for me.  It explains that the private key must be emailed with the certificate in a .p12 file.

Me and the Admin I worked with from the Apple Developer team at my university would not have known why we could not find the Developer ID Application certificate had it not been for this Apple documentation.

Note, an Apple Developer account can generate 5 Developer ID Application certificates and they need to be renewed/recreated every 5 years.

Advertisements

Today’s Apple Feedback: Underlined Event Day in Mail Wrong When Tap-creating an Event

I’d been victim to this bug and forgetting about work meetings a few times recently – and I knew I’d created an event with a reminder for each forgotten meeting! Luckily the meetings were in my office and I was in the vicinity the couple times it had happened recently (and this tends to happen for Monday meetings most frequently). This morning, Friday May 11, I got a confirmation email for a meeting at 1:30 on Monday.  I underlined that text, because that’s how it appeared in Mail, as you’ll see in the screenshot below.  Apple had detected the event time/day text and underlined it so that I could conveniently create a meeting appointment in my calendar app and I knew it would have my default 1-day prior alert. So I tapped the text and entered the meeting title and location and observed that the default-entered time was from 1:30 to 2:30.  I didn’t check the day!  But I knew that events had gone missing in the past, so after creating the event, I set a reminder to double-check it was still there when I got to work.  I had assumed that the events were somehow getting deleted via some sync issue.

When I got to work, I double-checked my calendar and the event wasn’t there!  I then searched my calendar and discovered that the event had been created for Thursday May 10th instead of the expected Monday May 14th!  And today (when I created the event) is Friday May 11th!  Thus, Today’s Apple (iPhone) Feedback:

Taping underlined event time/day in mail creates event yesterday instead of underlined weekday

On Friday May 11, I created an event via the underlined text: “1:30 on Monday” in Mail on my iPhone 6S. I’d noticed events created on my iPhone going missing in the past, so I created a reminder to check my calendar when I got in. It was missing!, so I searched for it. It had been created for Thursday (yesterday!). I hadn’t touched the day when I created the event. All I had done was add a title & enter a location. I observed the time was 1:30, but hadn’t double-checked the day. I just did it again & it’s still creating the event on Thursday!:

Please fix this. If the underlined text tapped says “Monday”, should be created on Monday by default!

Note, I had pasted URLs to my screenshots because Apple’s feedback form doesn’t allow you to attach images.

I’m guessing that the wrong day possibly came from the fact that the email thread discussing a possible meeting time started on Thursday.  Plus, the first underlined proposal of 1:30 didn’t have a day of the week underlined with it.  So my guess is that that underlined time got associated with the current day (even though it was past 1:30 on Thursday when we started emailing about meeting).  And it seems possible, albeit not a good design decision, that when you tap underlined text to create an event in Mail, that despite the particulars of the specific underlined text, that Apple is re-parsing the entire email to extract what it thinks the intended day & time of the event is likely to be.  It’s just getting it wrong in this case.

If you don’t want to miss meetings because of this but, please consider echoing my Apple Feedback.

Services to sum or subtract highlighted numbers and calculate equations

Years ago, I discovered the convenience of treating the Spotlight search as a calculator.  If you paste in an equation, the top result will be what the calculator app produces given the math you’ve typed or paste in.  I take a lot of notes in my work and frequently have a simple equation to calculate or numbers to sum or subtract.  It’s easy enough to copy and paste an equation into spotlight or paste a set of numbers (with some manual clean-up) to Excel or even search & replace with plus or minus signs & paste into spotlight, but you’d be surprised how much more efficient it feel to do this automatically.  You can even have it paste the result after the end of the highlight.

Combine this with the fact that many text editing apps allow you to select columns of text, and it becomes a trivial matter to do things with masses of numbers in any text and any app.

The sum & subtract automator services also conveniently strip out non-number characters, so you can highlight any numbers that have text in between and sum or subtract them.

Sum Service

Let’s start with the Sum service.  Here’s an example of how it works:

sum_demo.gif

As seen above, you simply:

  1. Select text with the numbers you want to sum
  2. Right-click the selection, and
  3. Select Services->Sum.

The numbers are parsed and added using Spotlight.  In the demo above, I simply tap the escape ket to exit spotlight after seeing the result.  But, you could select & copy the result to use it how you wish, directly from the spotlight result listing.

Subtract Service

The subtract service works the same way as the Sum Service above, but instead of adding all the numbers, it simply takes the first number and subtracts all the rest.  Both services ignore non-numbers and can handle decimals.  It even knows the difference between hyphens in words versus negative numbers.  However, they may have some trouble with non-standard hyphen characters and periods in full sentences.

Calculate (& Append Result) Service(s)

The Calculate Service (or “Calculate & Append Result”) will take any equation that Spotlight (i.e. the Calculator app) can handle and compute the result.  And if you know already that you will want to append the result after the highlighted text in the form of ” = answer”, you can alternatively select the “Calculate & Append Result” Service.  Here is a demo using the service:

calc_demo.gif

Installation

  1. Go to the github gist containing the Applescript code for each service
  2. Copy the code from one of the 3 files in the github gistcopygistcode.png
  3. Open Automator.appautomatordock.png
  4. Select service “Service”/gear icon from the dropdown sheet & click “Choose”selectservice.png
  5. Drag the “Run AppleScript” action into your workflowautomatorapplescript.gif
  6. Replace the purple code in the Run AppleScript action with the code you copied in step 1
  7. Save the workflow and name it however you would like it to appear in the services contextual menu (E.g. “Calculate & Append Result.workflow” – the extension will not appear in the menu)
  8. Repeat for the remaining 3 services.

The workflows/services will be saved automatically to your Library/Services directory in your home directory.  If you right-click the file name at the top of the window in Automator, you can select the Services folder to reveal it in the Finder.  You can then copy that file and send it to any other computer you would like to also have that service.

Have fun!

Disclaimers: These services are only intended as a quick and dirty solution to work in any context, & any app.  If you have a repeated common use-case, consider other solutions.  Note also that any application which reserves the arrow keys for some function when the shift key is held down, other than modifying the most recent selection, this service will fail.  Some applications, such as java applications, modify selections using shift-arrow navigation differently, depending on the direction of the mouse drag during text selection.  This can produce unexpected results.  A work-around for both such issues can be to use the strategy used for Terminal.app, but this would required modification to the code.  A few of the features in the script rely on some tricks such as statically set delays and command-line calls, necessary to either wait for an application to respond or to control the focus of various windows.  If your computer is very busy or has any configuration issues, the proper functioning of these services may be disrupted.  These services were developed and tested on macOS High Sierra, 10.13.4.  They may or may not work in other macOS versions.

Today’s Apple Feedback: High Sierra is a Heavy Sleeper

Since upgrading recently to High Sierra, I’ve been dealing with the fact that my keyboard would no longer wake my computer from the screen saver.  All keyboard presses (other than modifier keys) would only cause the computer to beep (and screen-flash, since I set that in the accessibility preferences).  I finally decided to resolve this issue today, since I am between projects.  It took awhile to dig up a solution via google search-term tinkering, so I thought I would share a work-around I found here.

Briefly, to work-around this issue and get your mac to wake up upon any keyboard press, you must open up System Preferences, click the Mission Control preferences pane, and turn on “Displays have separate spaces”:

mcsepspaces.png

Note, you will have to log out and back in (no restart required though), as is noted in the gray message next to the setting seen in the image above.  After that, the keyboard should start being able to wake your computer.  If you turn this setting back off & log out/in, the problem will recur, so unfortunately, if you have multiple displays, are experiencing this issue, and don’t want them to have separate spaces, you’re out of luck.  I suggest you submit feedback to Apple, as I did below:

Keyboard presses & mouse motion don’t wake from screen saver since High Sierra upgrade

Since installing High Sierra, I have been unable to wake my computer from the screen saver using the keyboard. All keyboard presses result in a beep/screen-flash (since I have that set). A work-around described here works:

https://forums.macrumors.com/threads/screensaver-behavior-in-high-sierra.2075712/

By turning on “Displays have separate spaces” in the Mission Control system prefs, logging out, & back in, the problem no longer occurs. The problem can be made to recur by reversing that process.

I have 10.13.3 (which is not listed below in the select list).

Automator Services for finding coordinates in DNA/AA strings

Do you write code to analyze or modify DNA or proteins?  Do you do your work on a Mac?  If so, I have a few Automator Services, written in AppleScript, that you may find very handy:

  1. Get the sequence (& alignment) length of a selected nucleotide string
  2. Get the sequence length of any selected string (e.g. protein or quality string)
  3. Show where a coordinate is in any selected string (including white-spaces)
  4. Show where a coordinate is in a selected sequence (e.g. protein or quality string)
  5. Show where a nucleotide coordinate is in a selected sequence
  6. Show where an alignment coordinate is in a selected nucleotide sequence
  7. Get the reverse complement of a selected nucleotide sequence
  8. Guess the barcodes present in a FastQ file *NEW

With these, you can highlight a sequence anywhere in any application and either get the selection length or show where a supplied coordinate is in the selected sequence.

Each service, once installed, will show up in the contextual menu that shows up anytime you right-click any selected text, system-wide on your mac, under the services sub-menu, e.g.:

countntsservicemenu.png

Here are the full details of how to use each service and what it does:

1. Get the sequence (& alignment) length of a selected nucleotide string

Name: Count Nucleotides

countntsoutput.png

This service does a bit more than count nucleotides.  As seen in the example on the right, it reports the number of nucleotides in the selection (sequence length), the length of the selected alignment, the number of discrete & ambiguous nucleotides, and a breakdown of all case-insensitive sequence characters (including gaps and ambiguous nucleotides).

Spaces, tabs, newlines, carriage returns, numbers, or any other non-sequence characters are completely ignored, so you can select any sequence, even if it is formatted & displayed with coordinates.  Only the sequence found inside the highlighted text is considered.  The first selected sequence character is coordinate 1.

2. Get the sequence length of any selected string (e.g. protein or quality string)

Name: Count Sequence Characterscountnonwschars.png

This service counts every character selected except for spaces, tabs, newlines, and carriage returns.  It’s good for getting the length of selected unaligned protein sequences (with no formatted coordinates in the selection) or of quality strings.  Note, there is currently no service for aligned amino acid sequences, but if you would like such a service, let me know in the comments and I’ll whip one up.  I work mostly with DNA, thus I haven’t had much need for aligned protein coordinate determinations.

3. Show where a coordinate is in any selected string (including white-spaces)

Name: Select N Characters

This service works only on “solid sequence” (i.e. having no whitespaces, hard returns, or for that matter: any non-sequence characters).  See services 4-6 for sequence-specific functions.  The way this service shows where a coordinate is, is by changing the length of the selection.  The resulting last character of the selection after the length modification is the length supplied by you, the user.  For example, if you tell it to select 4 characters in this string you selected: ATGCCGTAG, the selection will end up as: ATGCCGTAG.

lengthprompt.png

There are 2 ways to supply the coordinate.  The default way is to grab the coordinate from the clipboard, so all you have to do is copy the number you want to use to set the selection length.  However, if the content of the clipboard is not a number, a popup window will appear to ask you to enter the desired selection length.

 

To use this service:

  1. [Optional] Copy a number/length indicating the amount of the sequence you want to select.
  2. Select any length of sequence from the start position (position 1)
  3. Right-click the selection and select Services -> Select N Characters
  4. [If you didn’t do step 1] Enter the length of sequence you want to select

This script alters the selection length of the selected text you right-clicked on in the window in which you clicked on the sequence, regardless of application.  However, if you are in Terminal.app, it displays the selection result in a popup window instead of in the Terminal itself.  This is because the modification of the selection length is accomplished by shift-arrow keystroke emulation and this is not a means by which you can modify a selection in the Terminal app.  This has 1 side effect.  Normally, if the entered length is longer than the selection, in any other app, that’s not a problem and the selection just expands, but in Terminal’s popup result window, all the service has access to is the selected text, so placeholder ‘N’s are appended to show the desired sequence length.

lengthresult-terminal.pngThere are other drawbacks to this Terminal selection-length work-around.  The font is not fixed-width and the width of the popup window is fixed at a fairly narrow size, thus large sequences cannot be displayed very well.

Since the selection modification happens via emulated keystrokes, it takes a little time for the final selection to be made, but you’ll see how fast it goes as you watch the selection being made.  Since it’s not instantaneous, the script will either adjust the selection from the end or select anew from the beginning for efficiency.

4-8. New services

Names: Select N Sequence Characters, Select N Nucleotides, Select N Alignment Characters, Reverse Complement, & Guess barcodes

These services operate just like Select N Characters, but take the character type into account.

Select N Sequence Characters doesn’t include whitespace characters such as spaces, tabs, and newlines in the calculation of a coordinate in a string.

Select N Nucleotides doesn’t include non-nucleotide characters such as white spaces, gap characters, numbers, etc. in the calculation of a coordinate in a string.

Select N Alignment Characters behaves just like Select N Nucleotides but includes gap characters in the calculation of a coordinate in a string as the one exception.

Guess Barcodes allows you to right-click on a file and find out what the likely barcodes are.  It takes a little bit to run and makes some common assumptions, but if you think the results are wrong, you are given the opportunity to tweak the parameters and run again.

Installation

  1. Go to the github gist containing the Applescript code for each service
  2. Copy the code from one of the 3 files in the github gistcopygistcode.png
  3. Open Automator.appautomatordock.png
  4. Select service “Service”/gear icon from the dropdown sheet & click “Choose”selectservice.png
  5. Drag the “Run AppleScript” action into your workflowautomatorapplescript.gif
  6. Replace the purple code in the Run AppleScript action with the code you copied in step 1
  7. Save the workflow and name it however you would like it to appear in the services contextual menu (E.g. “Count Non-Whitespace Characters.workflow” – the extension will not appear in the menu)
  8. Repeat for the remaining 6 services.

The workflows/services will be saved automatically to your Library/Services directory in your home directory.  If you right-click the file name at the top of the window in Automator, you can select the Services folder to reveal it in the Finder.  You can then copy that file and send it to any other computer you would like to also have that service.

Just try your new services out by right-clicking on selected text anywhere.selectncharsexample.gif

And as you can see from the example above, Select N Characters works on any text.

Have fun!

Disclaimers: These services are only intended as a quick and dirty solution to work in any context, & any app.  If you have a repeated common use-case, consider other solutions.  Note also that any application which reserves the arrow keys for some function when the shift key is held down, other than modifying the most recent selection, this service will fail.  Some applications, such as java applications, modify selections using shift-arrow navigation differently, depending on the direction of the mouse drag during text selection.  This can produce unexpected results.  A work-around for both such issues can be to use the strategy used for Terminal.app, but this would required modification to the code.  A few of the features in the script rely on some tricks such as statically set delays and command-line calls, necessary to either wait for an application to respond or to control the focus of various windows.  If your computer is very busy or has any configuration issues, the proper functioning of these services may be disrupted.  These services were developed and tested on macOS Sierra, 10.12.6.  They may or may not work in other macOS versions.

Today’s Apple Feedback: Messages on an iPhone 6s with Sprint do not convert to SMS like they did on the iPhone 4s

Immediately upon my wife and I upgrading our pair of iPhone 4s’s to 6s’s, I called to complain that I was not receiving messages from my wife while on calls anymore.  I was given the run-around both from Sprint and from Apple, stating that, as I already knew, you can’t do data and phone calls at the same time on Sprint’s CDMA network. BUT, you can get SMS’s while on a call and after some testing, I figured out that there was nothing wrong with our new phones receiving SMS messages.  The problem was on the other end – with sending them.

With our 4s’s, both with iMessages enabled (you can confirm this from our message history), if the message wouldn’t go through (because I was on a call), her phone would convert the message to a (green) SMS and try sending it again. I’d receive it while on a call and hear the message chime over my phone call.

This does not work on an iPhone 6s, though I don’t know if it was specific to the hardware itself or if it could have had to do with a newer iOS that came with the 6s’s that couldn’t be installed on a 4s.  On a 6s, Apple appears to have dumbed down message sending.  It will only attempt to send a message as an SMS is the sender has no wifi or data connection.  It no longer pays any mind to the receiver.  If they’re on a call, the message just gets buffered somewhere and once the other person gets off their call and again connects to a data signal, whether it’s a phone carrier’s data connection or a wifi signal, they get all their buffered messages at once.

I commute to and from work on my bike.  It’s an hour ride and I like to pass the time by talking on the phone.  My wife invariably messages me while I’m on my call, either about dinner or wanting to know when I’m getting home or whatever.  I pretty much expect to hear from her every time.  I would usually hang up whatever call I was on (usually some family member) and ask Siri to read my messages to me while I rode.

I thought that when we bought the 6s’s, they would be better and more capable.  I did not expect their capabilities to regress, so I’ve called to complain about this numerous times. I’ve tested with numerous iPhones and Android phones.  My latest feedback to Apple is below:

Convert iMessages sent to me to SMSs during calls on sprint

I’m submitting this issue again. When my wife and I bought our iPhone 6s’s about a year ago (staying with sprint), the first thing I noticed that they could not do that our 4s’s could was automatically convert an iMessage to an SMS when the other one of us was on the phone. E.g. I ride my bike for an hour commute and I talk on the phone the whole time. With our 4s’s (on Sprint), when my wife sent me a message (with iMessage enabled), which she always does at some point during my ride, the message would get converted to an SMS and I would receive it while on the call. But with our 6s’s set up the same way, I do not get her messages until I hang up the phone, i.e. her phone does not convert the iMessages to SMS’s. We’ve been with sprint for forever and our 4s’s could do this.

iOS 11.0.3

In fact, some Apple support people I’ve spoken to had the same complaint about not receiving messages.  Apple has been unresponsive on this issue and it’s ridiculous to have to turn off iMessages to be able to get around this issue.  So I am blogging this out there to raise awareness that it doesn’t have to be this way!

Complain to Apple about this issue and have them fix their newer phones to restore the capability of converting iMessages to SMS’s the way the 4s used to do.  If enough of us complain, maybe they’ll deign to get around to it.

How to make Safari 10 auto-open specific file types

I’ve been annoyed for awhile now that Safari was auto-opening text files that I was trying to download in rapid succession via option-click on a series of links. The text documents kept popping up in front of my browser window and getting in the way.  Safari used to have preferences that you could set to tell it what to do with specific file types, but not anymore – at least not since Safari 10 on MacOS Sierra (10.12.x). The only options were to make Safari auto-open “safe” files or not auto-open any files at all. I was about to give up again.  I’ve tried to figure this out on multiple other occasions, but I’d finally had enough and decided to roll my own using Automator and some clever scripting… Continue reading