¿Cómo pausar un video de YouTube mediante un atajo de teclado o desde la barra de menú?

¿Existe algún software que permita pausar (y cancelar la pausa) un video de YouTube que se está reproduciendo actualmente (o, idealmente, cualquier medio de video/audio en línea), con un atajo de teclado o un botón de fácil acceso (p. ej., un botón que se encuentra en la barra de menú, ubicada en la parte superior derecha de la pantalla)? Cuantos menos clics sean necesarios, mejor.

La clave aquí es que quiero la posibilidad de pausar el video en cualquier aplicación, es decir, cuando Google Chrome no es la aplicación principal (por ejemplo, TextEdit o Microsoft Word es la aplicación principal).

iOS tiene este atajo incorporado. Si se desliza desde la parte inferior de la pantalla hacia la parte superior, aparecen los controles multimedia. Estos controles pueden manipular cualquier audio que se origine en una pestaña de Safari.

Mi navegador web es Google Chrome.

OS X El Capitán, versión 10.11.6.


También estaría abierto a lograr esto con un AppleScript (que luego se puede asignar a una combinación de teclas en FastScripts.app). Pero no puedo imaginar que una tarea tan compleja sea posible a través de AppleScript.

Entonces, ¿está buscando una solución de barra de menú en lugar de simplemente tocar la barra espaciadora? ¿O haciendo clic con el mouse en el botón Reproducir/Pausar?
@Monomeeth Por favor, vea mi edición. Olvidé mencionar que Chrome no es la aplicación activa; el video se reproduce en segundo plano. Entonces, para pausar el video, tengo que hacer clic en la ventana de Chrome, hacer clic en la pestaña que contiene el video y solo entonces puedo usar la barra espaciadora o hacer clic con el botón izquierdo para pausar el video.
estás buscando algo como si entendiera la pregunta: beardedspice.github.io
@enzo He descargado BeardedSpice y es exactamente lo que estoy buscando. BeardedSpice es perfecto para mis necesidades. Si desea publicar esto como respuesta, lo aceptaré con gusto. ¡Gracias!
De hecho, me pregunto por qué Google no ha hecho que el botón Reproducir/Pausar (F8) del teclado funcione para YouTube, dado que funciona como se esperaba cuando visitas Google Play Music en Chrome.

Respuestas (2)

********** SOLUCIÓN ACTUALIZADA **********

Esta actualización es una solución directa a la pregunta original del OP.

El siguiente código AppleScript agregará un elemento de menú de estado "Reproducir/Pausar YouTube" con las opciones para reproducir o pausar cualquier video de YouTube en Google Chrome o Safari, ya sea que los navegadores estén visibles o no. Guarde este siguiente código AppleScript como una aplicación "permanecer abierta" en Script Editor.app.

use framework "Foundation"
use framework "AppKit"
use scripting additions

property StatusItem : missing value
property selectedMenu : ""
property defaults : class "NSUserDefaults"
property internalMenuItem : class "NSMenuItem"
property externalMenuItem : class "NSMenuItem"
property newMenu : class "NSMenu"

my makeStatusBar()
my makeMenus()

on makeStatusBar()
    set bar to current application's NSStatusBar's systemStatusBar
    set StatusItem to bar's statusItemWithLength:-1.0
    -- set up the initial NSStatusBars title
    StatusItem's setTitle:"Play/Pause YouTube"
    -- set up the initial NSMenu of the statusbar
    set newMenu to current application's NSMenu's alloc()'s initWithTitle:"Custom"
    newMenu's setDelegate:me (*
    Requied delegation for when the Status bar Menu is clicked  the menu will use the delegates method (menuNeedsUpdate:(menu)) to run dynamically update.*)
    StatusItem's setMenu:newMenu
end makeStatusBar

on makeMenus()
    newMenu's removeAllItems() -- remove existing menu items
    set someListInstances to {"Play/Pause YouTube - Safari", "Play/Pause YouTube - Chrome", "Quit"}
    repeat with i from 1 to number of items in someListInstances
        set this_item to item i of someListInstances
        set thisMenuItem to (current application's NSMenuItem's alloc()'s initWithTitle:this_item action:("someAction" & (i as text) & ":") keyEquivalent:"")
        (newMenu's addItem:thisMenuItem)
        (thisMenuItem's setTarget:me) -- required for enabling the menu item
    end repeat
end makeMenus

on someAction1:sender
    clickClassName2("ytp-play-button ytp-button", 0)
end someAction1:

on someAction2:sender
    clickClassName("ytp-play-button ytp-button", 0)
end someAction2:

on someAction3:sender
    quit me
end someAction3:

to clickClassName2(theClassName, elementnum)
    if application "Safari" is running then
        try
            tell application "Safari"
                tell window 1 to set current tab to tab 1 whose URL contains "youtube"
                do JavaScript "document.getElementsByClassName('" & theClassName & "')[" & elementnum & "].click();" in document 1
            end tell
        end try
    end if
end clickClassName2

to clickClassName(theClassName, elementnum)
    tell application "Google Chrome" to (tabs of window 1 whose URL contains "youtube")
    set youtubeTabs to item 1 of the result
    tell application "Google Chrome"
        execute youtubeTabs javascript "document.getElementsByClassName('" & theClassName & "')[" & elementnum & "].click();"
    end tell
end clickClassName

ingrese la descripción de la imagen aquí

Si desea que su nueva... Play Pause YouTube Status Menu.app solo sea visible en el menú de estado y no en el Dock, puede hacer clic derecho en la aplicación en Finder y seleccionar la opción "Mostrar contenido del paquete". En la carpeta Contenidos, abra el archivo Info.plist en cualquier editor de texto y agregue las siguientes dos líneas. Luego guarde y cierre ese archivo.

<key>LSBackgroundOnly</key>
<true/>

Si no se siente cómodo editando el archivo .plist directamente, el siguiente código AppleScript le permitirá elegir la aplicación para ocultarla del Dock cuando se esté ejecutando.

Si la aplicación elegida ya está configurada para ocultarse en el Dock, la única opción que se le dará es mostrar la aplicación para que no sea visible en el Dock mientras se está ejecutando... y viceversa.

Esta secuencia de comandos es especialmente útil para ocultar "aplicaciones abiertas" con iconos de aplicaciones de controladores inactivos para que no aparezcan en el Dock mientras se ejecuta.

property fileTypes : {"com.apple.application-bundle"}
property plistFileItem : "  <key>LSBackgroundOnly</key>" & linefeed & " <true/>"

activate
set chosenApp to (choose application with prompt ¬
    "Choose  The Application You Want Hidden From The Dock While It Is Running" as alias)

tell application "System Events" to set appName to name of chosenApp
set plistFile to ((POSIX path of chosenApp) & "/Contents/info.plist") as string
set plistFileContents to (read plistFile)
set plistFileItemExists to plistFileItem is in plistFileContents

if plistFileItemExists then
    activate
    set theChoice to button returned of (display dialog ¬
        "Would you like to un-hide " & quote & appName & quote & ¬
        " from the Dock while it's running?" buttons {"Cancel", "Un-Hide"} ¬
        default button 2 cancel button 1 with title "Make A Choice")
else
    activate
    set theChoice to button returned of (display dialog ¬
        "Would you like to hide " & quote & appName & quote & ¬
        " from the Dock while it's running?" buttons {"Cancel", "Hide"} ¬
        default button 2 cancel button 1 with title "Make A Choice")
end if

if theChoice is "Hide" then
    tell application "System Events" to tell contents of property list file plistFile ¬
        to make new property list item at end with properties ¬
        {kind:string, name:"LSBackgroundOnly", value:true}
else if theChoice is "Un-Hide" then
    tell application "System Events" to tell contents of property list file plistFile ¬
        to make new property list item at end with properties ¬
        {kind:string, name:"LSBackgroundOnly", value:false}
else
    return
end if


************ SOLUCIÓN ORIGINAL ************

Este script hará clic en el botón Reproducir/Pausar en un video que se reproduce en YouTube en Google Chrome, ya sea que Google Chrome esté visible o no.

to clickClassName(theClassName, elementnum)
    tell application "Google Chrome" to (tabs of window 1 whose URL contains "youtube")
    set youtubeTabs to item 1 of the result
    tell application "Google Chrome"
        execute youtubeTabs javascript "document.getElementsByClassName('" & theClassName & "')[" & elementnum & "].click();"
    end tell
end clickClassName    

clickClassName("ytp-play-button ytp-button", 0)

Esta es la versión del script para trabajar con Safari

to clickClassName2(theClassName, elementnum)
    tell application "Safari"
        tell window 1 to set current tab to tab 1 whose URL contains "youtube"
        do JavaScript "document.getElementsByClassName('" & theClassName & "')[" & elementnum & "].click();" in document 1
    end tell
end clickClassName2

clickClassName2("ytp-play-button ytp-button", 0)

En un esfuerzo por darle al OP una solución AppleScript completa, he llevado mi respuesta original un paso más allá.

ACTUALIZAR

Finalmente lo resolví. Creé una aplicación AppleScript en Xcode. Originalmente, mi proyecto solo comenzó con una ventana de un botón para controlar los videos de YouTube actualmente activos en Chrome o Safari. Este proyecto se ha convertido un poco en una aplicación que contiene varias utilidades. Este GIF muestra el botón de pausa de YouTube que controla YouTube en Chrome y Safari. Enlacé las acciones de los botones al AppleScript que escribí originalmente en el editor de scripts.

ingrese la descripción de la imagen aquí

Esta es una instantánea de la aplicación Xcode trabajando en el archivo AppDelegate.applescript.

ingrese la descripción de la imagen aquí

Aquí está el código en ese archivo que creé para que el programa funcione.

script AppDelegate

    property parent : class "NSObject"
    
    
    -- IBOutlets
    property theWindow : missing value
    
    to clickClassName(theClassName, elementnum) -- Handler for pausing YouTube in Chrome
        if application "Google Chrome" is running then
            try
                tell application "Google Chrome" to (tabs of window 1 whose URL contains "youtube")
                set youtubeTabs to item 1 of the result
                tell application "Google Chrome"
                    execute youtubeTabs javascript "document.getElementsByClassName('" & theClassName & "')[" & elementnum & "].click();"
                end tell
            end try
        end if
    end clickClassName
    
    to clickClassName2(theClassName, elementnum) -- Handler for pausing YouTube in Safari
        if application "Safari" is running then
            try
                tell application "Safari"
                    tell window 1 to set current tab to tab 1 whose URL contains "youtube"
                    do JavaScript "document.getElementsByClassName('" & theClassName & "')[" & elementnum & "].click();" in document 1
                end tell
            end try
        end if
    end clickClassName2

    on doSomething:sender -- Calls the Chrome YouTube Handler
        clickClassName("ytp-play-button ytp-button", 0)
    end doSomething:

    on doSomething14:sender -- Calls the Safari YouTube Handler
        clickClassName2("ytp-play-button ytp-button", 0)
    end doSomething14:

    on doSomething2:sender -- Hide and or show the Menu Bar
        tell application "System Preferences"
            reveal pane id "com.apple.preference.general"
        end tell
        tell application "System Events" to tell process "System Preferences" to tell window "General"
            click checkbox "Automatically hide and show the menu bar"
        end tell
        delay 1
        quit application "System Preferences"
    end doSomething2:
    
    on doSomething3:sender -- Sets Display resolution to the second lowest setting (15 inch Built In Retina Display - MBP)
        tell application "System Preferences"
            reveal anchor "displaysDisplayTab" of pane "com.apple.preference.displays"
        end tell
        tell application "System Events" to tell process "System Preferences" to tell window "Built-in Retina Display"
            click radio button "Scaled" of radio group 1 of tab group 1
            click radio button 2 of radio group 1 of group 1 of tab group 1
        end tell
        quit application "System Preferences"
    end doSomething3:
    
    on doSomething4:sender -- Sets Display resolution to the second highest setting (15 inch Built In Retina Display - MBP)
        tell application "System Preferences"
            reveal anchor "displaysDisplayTab" of pane "com.apple.preference.displays"
        end tell
        tell application "System Events" to tell process "System Preferences" to tell window "Built-in Retina Display"
            click radio button "Scaled" of radio group 1 of tab group 1
            click radio button 4 of radio group 1 of group 1 of tab group 1
        end tell
        quit application "System Preferences"
    end doSomething4:
    
    on doSomething5:sender -- Sets Display resolution to the highest setting (15 inch Built In Retina Display - MBP)
        tell application "System Preferences"
            reveal anchor "displaysDisplayTab" of pane "com.apple.preference.displays"
        end tell
        tell application "System Events" to tell process "System Preferences" to tell window "Built-in Retina Display"
            click radio button "Scaled" of radio group 1 of tab group 1
            click radio button 5 of radio group 1 of group 1 of tab group 1
        end tell
        quit application "System Preferences"
    end doSomething5:
    
    on doSomething6:sender -- Sets Display resolution to the lowest setting (15 inch Built In Retina Display - MBP)
        tell application "System Preferences"
            reveal anchor "displaysDisplayTab" of pane "com.apple.preference.displays"
        end tell
        tell application "System Events" to tell process "System Preferences" to tell window "Built-in Retina Display"
            click radio button "Scaled" of radio group 1 of tab group 1
            click radio button 1 of radio group 1 of group 1 of tab group 1
            delay 0.1
            click button "OK" of sheet 1
            quit application "System Preferences"
        end tell
    end doSomething6:

    on doSomething7:sender -- Displays a dialog with your current IP
        tell current application to display dialog (do shell script "curl ifconfig.io") with icon 2 buttons "OK" default button 1 with title "Your Current IP Address Is.." giving up after 5
    end doSomething7:
    
    on doSomething8:sender -- Shows hidden files in Finder
        do shell script "defaults write com.apple.finder AppleShowAllFiles TRUE\nkillall Finder"
    end doSomething8:
    
    on doSomething9:sender -- Hides hidden files in Finder if they are showing
        do shell script "defaults write com.apple.finder AppleShowAllFiles FALSE\nkillall Finder"
    end doSomething9:

    on doSomething10:sender  -- Brightness Highest
        tell application "System Preferences"
            reveal anchor "displaysDisplayTab" of pane "com.apple.preference.displays"
        end tell
        tell application "System Events" to tell process "System Preferences" to tell window "Built-in Retina Display"
        set value of value indicator 1 of slider 1 of group 2 of tab group 1 to 12
        end tell
        quit application "System Preferences"
    end doSomething10:

    on doSomething11:sender -- Brightness Lowest
        tell application "System Preferences"
            reveal anchor "displaysDisplayTab" of pane "com.apple.preference.displays"
        end tell
        tell application "System Events" to tell process "System Preferences" to tell window "Built-in Retina Display"
        set value of value indicator 1 of slider 1 of group 2 of tab group 1 to 0.1
        end tell
        quit application "System Preferences"
    end doSomething11:

    on doSomething12:sender -- Zoom
        tell application "System Events"
            key code 28 using {command down, option down}
        end tell
    end doSomething12:

    on doSomething13:sender -- Dictation On/Off
        tell application "System Events"
            keystroke "x" using {option down}
        end tell
    end doSomething13:

    on doSomething15:sender -- Enables Screensaver as Desktop background
        tell application "System Events"
            do shell script "/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background"
        end tell
    end doSomething15:

    on doSomething16:sender -- Kills Screensaver Desktop background
        try
            tell application id "com.apple.ScreenSaver.Engine" to quit
        end try
    end doSomething16:


    on applicationWillFinishLaunching:aNotification
        -- Insert code here to initialize your application before any files are opened

    end applicationWillFinishLaunching:
    
    on applicationShouldTerminate:sender
        -- Insert code here to do any housekeeping before your application quits

        
        return current application's NSTerminateNow
    end applicationShouldTerminate:

    on applicationShouldTerminateAfterLastWindowClosed:sender -- Quits app when clicking red x
        
        return TRUE
        
    end applicationShouldTerminateAfterLastWindowClosed:

end script

Actualicé el código para que la pestaña de YouTube en Chrome no tenga que ser la pestaña visible o activa al hacer clic en el botón de pausa de YouTube creado en Xcode.

Aquí hay un enlace para descargar todo el proyecto Xcode

ingrese la descripción de la imagen aquí

ADVERTENCIA: La función de protector de pantalla del escritorio congelará la aplicación. Después de forzar el cierre y volver a abrir, funcionará la función de protector de pantalla del escritorio para salir del protector de pantalla activo.

Pensamientos posteriores: probablemente debería haber envuelto cada uno de los códigos AppleScript en declaraciones de "intentar" para evitar todo tipo de mensajes de error para aquellos que juegan con este proyecto, que no tienen el mismo sistema y tipo de computadora que yo. (MacBook Pro 15" OS Sierra 10.12.6)

Para que la función de zoom funcione, debe estar habilitada en las preferencias del sistema.

ingrese la descripción de la imagen aquí

Para que la opción "Activar/desactivar dictado" funcione correctamente, el atajo para habilitar los comandos de dictado en las preferencias del sistema debe coincidir con el atajo utilizado en la secuencia de comandos.

ingrese la descripción de la imagen aquí

on doSomething13:sender -- Dictation On/Off
    tell application "System Events"
        keystroke "x" using {option down}
    end tell
end doSomething13:

Actualmente estoy trabajando en la capacidad de alternar entre la aplicación que se ejecuta en ventana o solo en la barra de menú

Dejando de lado el display dialing ...solo necesita esta línea de código tell application "Google Chrome" to execute front window's active tab javascript "document.getElementsByClassName('ytp-play-button ytp-button')['0'].click();". Dado que el OP quiere "pausar (y despausar) un video de YouTube que se está reproduciendo actualmente", Google ya está abierto y podría minimizarse con la reproducción de la pestaña activa y la línea de código antes mencionada actuará sobre ella. Por lo tanto, no es necesario activar la ventana o como en su código, use launchcomo esto es lo que se indica en la documentación, continúa en el siguiente comentario ...
"Si una aplicación ya se está ejecutando, enviarle un comando de inicio no tiene ningún efecto". ! Lo que nos lleva al clickClassName controlador , ¿por qué está allí? No es necesario en absoluto, ya theClassNameque elementnumse puede configurar directamente como en la línea citada en el primer comentario. Tener ese controlador está bien si tiene más de un uso de getElementsByClassName, sin embargo, en este caso y tal como lo veo, no lo tiene, a menos que vaya a construir un programa para hacer lo que BeardedSpice ya está haciendo. Lo que, por supuesto, requeriría una codificación considerable. ¡Aquí está la codificación superflua! :)
El controlador está allí y configurado en caso de que alguien quiera agregar al código, ahora puede llamarlo en cualquier parte del script. Si no recuerdo mal, intenté ejecutar el script sin el comando de inicio y terminó trayendo a Chrome a la ventana frontal, mientras que el comando de inicio realizó la acción con Chrome oculto... espera... Creo que primero lo intenté con un comando de activación , luego usé el lanzamiento en su lugar. Iré y probaré el código sin ninguna línea ahora brb
Estabas en lo cierto. El comando de lanzamiento no era necesario. Una vez más, gracias por señalar mis defectos de secuencias de comandos. He llegado a depender de que los señales LOL
Olvidé decir +1 de todos modos. :)
Toda esta maldita publicación me ha hecho arremangarme y encender Xcode para ver si puedo descubrir cómo diablos hacer un botón LOL
¡Esta es una solución muy inteligente! Decidí usar el programa de terceros, BeardedSpice, como se sugirió anteriormente en un comentario de enzo, porque BeardedSpice funciona incluso si la ventana de Chrome que contiene el video está minimizada y esta ventana de Chrome permanecerá minimizada. BeardedSpice también funciona con una letanía de reproductores multimedia en línea (no solo YouTube). Pero me sorprende que haya descubierto cómo hacer esto en AppleScript.
Sería muy bueno si comprimiera los archivos del proyecto Xcode y proporcionara un enlace de descarga para el archivo. :)
Solo estoy limpiando un poco el código y haré lo que me pidas en breve :)
Gracias por compartir los archivos del proyecto. Si pudiera votar tu respuesta nuevamente, lo haría. :)
Está todo bien. Mi placer hermano. Tenga en cuenta que solo he estado escribiendo y codificando durante poco más de seis meses, por lo que estoy seguro de que este proyecto tiene toneladas de errores. Definitivamente se necesita trabajar más en los elementos de los botones, pero definitivamente hay suficiente para jugar y tener una idea de lo que hice.
@wch1zpink, ¿puedes compartir el código postal conmigo también?
@KaushikJ Actualicé el enlace de descarga para el proyecto Xcode original. Desafortunadamente, algunas de las funciones de la aplicación (por ejemplo, Desktop Screen Saver) ya no funcionan con Catalina. Siéntete libre de descargar el proyecto y modificarlo como quieras.
@wch1zpink ¿dónde está el enlace de descarga? Parece que no encuentro uno

Aquí se explica cómo acceder a la barra de menús con AppleScript puro. Guardar como aplicación con stay open after run handler:

PD: robé el código para las funciones reales de reproducción/pausa de @wch1zpink, así que también vote su respuesta.

--AppleScript: menu bar script -- Created 2017-03-03 by Takaaki Naganoya adapted by Josh Brown
--2017 Piyomaru Software
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"
use framework "AppKit"
--http://piyocast.com/as/archives/4502

property aStatusItem : missing value

on run
    init() of me
end run

on init()
    set aList to {"Google Chrome", "⏯", "", "Safari", "⏯​", "", "Quit"}
    set aStatusItem to current application's NSStatusBar's systemStatusBar()'s statusItemWithLength:(current application's NSVariableStatusItemLength)

    aStatusItem's setTitle:"🎛"
    aStatusItem's setHighlightMode:true
    aStatusItem's setMenu:(createMenu(aList) of me)
end init

on createMenu(aList)
    set aMenu to current application's NSMenu's alloc()'s init()
    set aCount to 1
    repeat with i in aList
        set j to contents of i
        if j is not equal to "" then
            set aMenuItem to (current application's NSMenuItem's alloc()'s initWithTitle:j action:"actionHandler:" keyEquivalent:"")
        else
            set aMenuItem to (current application's NSMenuItem's separatorItem())
        end if
        (aMenuItem's setTarget:me)
        (aMenuItem's setTag:aCount)
        (aMenu's addItem:aMenuItem)
        if j is not equal to "" then
            set aCount to aCount + 1
        end if
    end repeat

    return aMenu
end createMenu

on actionHandler:sender
    set aTag to tag of sender as integer
    set aTitle to title of sender as string

    if aTitle is "Quit" then
        current application's NSStatusBar's systemStatusBar()'s removeStatusItem:aStatusItem
    end if
    #Chrome
    if aTitle is "⏯" then
        clickClassName("ytp-play-button ytp-button", 0)
    end if
    #Safari
    if aTitle is "⏯​" then
        clickClassName2("ytp-play-button ytp-button", 0)
    end if
end actionHandler:

to clickClassName(theClassName, elementnum)
    tell application "Google Chrome" to (tabs of window 1 whose URL contains "youtube")
    set youtubeTabs to item 1 of the result
    tell application "Google Chrome"
        execute youtubeTabs javascript "document.getElementsByClassName('" & theClassName & "')[" & elementnum & "].click();"
    end tell
end clickClassName

to clickClassName2(theClassName, elementnum)
    tell application "Safari"
        tell window 1 to set current tab to tab 1 whose URL contains "youtube"
        do JavaScript "document.getElementsByClassName('" & theClassName & "')[" & elementnum & "].click();" in document 1
    end tell
end clickClassName2
Veo dos problemas, el primero es que si sale de la barra de menú, el mosaico del Dock de la aplicación AppleScript todavía está allí y la aplicación debe cerrarse por separado. Puede agregar un quit comando al if aTitle is "Quit" then bloque después de la current application's ...línea de código para resolver esto. El segundo problema es que los símbolos que está utilizando no se muestran bien cuando se selecciona Usar barra de menú oscura y Preferencia general del sistema del Dock. Realmente no puedes ver los símbolos hasta que pasas el mouse sobre ellos. Puede considerar agregar texto al elemento del menú con los símbolos, por ejemplo:Play/Pause YouTube ⏯​
Gracias por las sugerencias sobre el ajuste del modo oscuro. Arreglaré el problema de dejar de fumar.
Además, al crear una aplicación adicional de menú como esta, me gusta ocultar el mosaico del Dock de la aplicación con el LSUIElement = 1agregado al name.app/Contents/Info.plistarchivo. En mi opinión, no es necesario que se muestre el Dock Tile de la aplicación para este tipo de aplicación adicional de menú.
@ user3439894 Sabía que tengo más de mis aplicaciones, solo olvidé agregarlas, no dude en editarlas.
También tenga en cuenta que el --http://piyocast.com/as/archives/4502comentario en el código ya no es válido, sin embargo, ¿esta respuesta Applescript se ejecuta desde la barra de menú? por el autor del código original contiene el código original que solía estar en esa URL. La respuesta también incluye el defaults comando para ocultar el Dock Tile, por ejemplo:defaults write /Applications/name_of_app.app/Contents/Info.plist LSUIElement -bool yes
@ user3439894 Sí, de ahí lo obtuve.