Applescript vs. Spaces in Lion (10.7)

3

En Snow Leopard (10.6), tenía un código de manzana que cambiaba iTunes entre "maximizado en Space 2" y "mini-jugador en todos los espacios":

set app_identifier to do shell script "echo 'com.apple.iTunes' | /usr/bin/perl -pe 'use encoding utf8; s/(\w)/\L$1/gi'"

tell application "iTunes"
    # if it's not already minimised...
    if minimized of front browser window is false then
        # switch to mini player
        set minimized of front browser window to true
        # set it to show on all spaces (the magic here is the "65544").
        set app_construct to (run script "{|" & app_identifier & "|: 65544}")
        tell application "System Events"
            tell expose preferences
                tell «class essp»
                    set spaces_bindings to get «class spcs»
                    set spaces_bindings to app_construct & spaces_bindings
                    set «class spcs» to spaces_bindings
                end tell
            end tell
        end tell
    else
        # switch to normal player
        set minimized of front browser window to false
        # set it to show on Space 2 (the magic here is the "2" - compare to the "65544" in the "set to all spaces" version).
        set app_construct to (run script "{|" & app_identifier & "|: 2}")
        tell application "System Events"
            tell expose preferences
                tell «class essp»
                    set spaces_bindings to get «class spcs»
                    set spaces_bindings to app_construct & spaces_bindings
                    set «class spcs» to spaces_bindings
                end tell
            end tell
        end tell
    end if
end tell

Se basa en scripts de enlace .

Esto no funciona en Lion.

¿Alguien sabe el equivalente a "asignar esta aplicación a todos los espacios" y "asignar esta aplicación al espacio 2" en Lion?

    
pregunta Ben Williams 29.10.2012 - 05:47

0 respuestas

Lea otras preguntas en las etiquetas