It may sound strange but I need to run a specific PKG installer whenever I trigger a specific custom keyboard shortcut. On Sierra 12.6 I've assigned a custom keyboard shortcut to sleep/lock-screen the Mac using shellScript/appleScript.

I have no idea how the shell script would look like.

I'd be grateful for any help and participation.

  • DMG files are disk image files, they are a type of container, not executables, nor are they installers per-se! They can contain an installer, but installers are typically package files, that have the .pkg extension. – user3439894 Jun 3 '19 at 0:56
  • @user3439894 You're completely right. It was my fault. The installer is a .pkg file. – Marelbiker Jun 3 '19 at 1:03
  • You can use something like: do shell script "open /path/to/filename.pkg" That said, your question lacks enough specific information for me to post a full and or complete answer. Also Finder and probably System Events can use their open command to start the .pkg file as well. So there is more than one way to go. – user3439894 Jun 3 '19 at 1:08
  • @user3439894 Thank you. I've saved it as a service. It works within Automator but the assigned keyboard shortcut cannot execute and launch the .pkg file. Is there any trick to know why it's not working? – Marelbiker Jun 3 '19 at 1:14
  • @user3439894 Thanks! I got it to work! There was sth wrong with the name, I think. I appreciate your help! – Marelbiker Jun 3 '19 at 1:20

You must log in to answer this question.

Browse other questions tagged .