Updates from September, 2022 Toggle Comment Threads | Keyboard Shortcuts

  • ThomasPowell 1:56 pm on September 17, 2022 Permalink | Reply
    Tags: , imessage   

    Annoy your friends with iMessage and AppleScript 

    Ever want to send a text message but you don’t have the energy to send it one word at a time? If you have macOS signed into iMessage, you can use AppleScript to automate sending one word at a time! (Warning: Doing this more than a few times will probably get you blocked by the people you know!)

    (The below script is available at send_message.applescript)

    #!/usr/bin/env osascript
    
    #  CREDIT TO https://chrispennington.blog/blog/send-imessage-with-applescript/ for how to send iMessages via AppleScript
    
    on run parameters
      # the number here is the number of seconds
      set theDelay to 3
    
      # Change this to the phone number of the iMessage contact to use
    
      set phoneNumber to "+1 (555) 555-1212"
      tell application "Messages"
        set targetBuddy to phoneNumber
        set targetService to id of 1st account whose service type = iMessage
        repeat with arg from 1 to length of parameters
          set textMessage to ( item arg of parameters )
          set theBuddy to participant targetBuddy of account id targetService
          send textMessage to theBuddy
          delay theDelay
        end repeat
      end tell
      log "Message sent"
    end run
    

    The repeat with arg from 1 to length of parameters and end repeat is essentially AppleScript’s for loop, with arg being the loop variable and 1 to length of parameters being the closed range on 1 to the end of the parameters list. Changing the value of theDelay can separate the messages by different number of seconds (currently 3 seconds)

    You need to chmod +x the script and update the phone number and then you can run it like:

    ./send_message.applescript This is a message to send

    Results of running AppleScript

This is a [Read 1:49PM] message to send with one blue bubble on each line
    Results of sending iMessages via AppleScript to myself

    You can group words with quotes as well

    ./send_message.applescript "This is a" "message to send"

    AppleScript with quoted arguments.

"This is a" "message to send"

    Remember: Use / abuse of this script may get you blocked. This script is purely for educational purposes.

     
  • ThomasPowell 11:08 pm on January 1, 2021 Permalink | Reply
    Tags: 2009 mac, old mac, yosemite   

    Reinstalling a Clean Copy of Mac OS X Yosemite 

    Use How to get old versions of macOS to download an installer for OS X Yosemite while running on Yosemite. Run the installer and it will install the full installer to /Applications/Install OS X Yosemite.app

    Use the command line from How to create a bootable installer for macOS substitution El\ Capitan for Yosemite in the El Capitan instructions.

    Hold down option while powering on the Mac to get the option to boot from USB Recovery.

     
  • ThomasPowell 12:07 pm on July 22, 2020 Permalink  

    Running Linux on a Mid-2009 MacBook Pro 

    [I’ve had decent luck with the iFixIt replacement batteries (Amazon affiliate link) for extending the lifespan of 3 different Macs, Linux or not]

    Me using the same Manjaro Live USB to boot Linux on a 2012 MacBook Air

    Apple and their aggressive EOL/EOS policies

    I have had an old mid-2009 MacBook Pro (2.26Mhz, Core 2 Duo P7550) that got left behind at macOS 10.11 (El Capitan). I’ve already gone through dealing with end-of-support with a 2011 MBP (no AirPlay server, no longer getting macOS updates, etc…), but the 2009 is old enough that Homebrew itself has dropped support officially. While that doesn’t prevent everything from working, once something won’t install, you either need to fix it yourself or give up.

    I was trying to get RDP up and running when I hit that issue, so I figured that it was time to see if I could install an operating system that was still supported on the 2009 MBP.

    Ubuntu Linux attempt

    I first went down the rabbit hole of Ubuntu, but the first set of instructions I found did not give me a warm fuzzy about being able to install Ubuntu and still have a working machine. I used Rufus to write an Ubuntu ISO to a USB drive and was able to live boot into Ubuntu. Of course, Linux and wifi isn’t always plug and play and the live boot did not recognize the MBP’s wifi card, so it would have been wired or nothing until I installed the OS.

    Hello Manjaro

    Time for a different strategy. I tried a different strategy and searched for Linux distros for a 2009 MacBook Pro. I decided to go with Manjaro XFCE and was able to write the ISO to my USB drive and have wifi working on live boot, so I swapped MacBook hard drives back to the original 5400 RPM 160GB hard drive that came with it.

    Manjaro with XFCE is far snappier than even my 2011 or 2019 MBPs. This is mainly because no bloat and very little running so far, but I’ve also installed Ruby 2.8.0-dev from Manjaro in rbenv on the 2009 (P7550 Core 2 Duo) vs. from the 2019 (i7-9750H 6 core) and the install/build time was 9m31s for the 2009 vs. 11m19s for the 2019 (yes, the 11 year old Mac was faster). This is probably a Clang vs. gcc and readline + openssl installation/build difference between the two environments, but I still found it interesting that the 2009 could win the race even with a head start.

    As for system load, the MBP 2009 not actively running anything on macOS 10.11 would register a consistent 2.0+ load and would take several minutes to be usable for typing in iTerm. By contrast, running XFCE, it required several tabs open in Firefox + Terminal + gvim for the load to break 1.0.

    Steps to get up and running:

    • Download Manjaro XFCE iso
    • Write image to USB drive using Rufus (dd or whatever if you are adequately skilled at that… Rufus was just painfully easy to kick off from a Windows 10 box)
    • Hold down option while booting to get boot menu.
    • Select your USB drive
    • Boot and verify that Linux is sufficiently usable for your MacBook
    • Install to a hard drive (I recommend using a different hard drive that is booting macOS, but then you’ll need tools for the mounting screws at a minimum.
    • Boot and enjoy

    Getting set up

    Having used yum, apt, and brew, pamac was a bit of a change. For example, I had to use pamac build ruby-build and pamac build rbenv vs. an install command.

    I have starship installed as well, which was relatively straightforward, but I still need to get the fonts right for unicode.

    Overall experience

    So far I’ve been pleasantly surprised with how useful my 2009 MacBook Pro is again. I’ve managed to type up this blog post without any lag from the processor, and the memory usage is sane as well (despite Firefox). I also miss having the pre-butterfly keyboard keys to type on for writing, so it was nice to experience those again.

     
c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel
%d bloggers like this: