Applescript vs. Spazi in Lion (10.7)

3

In Snow Leopard (10.6), ho avuto un AppleScript che ha attivato iTunes tra "maximized on Space 2" e "mini-player su tutti gli spazi":

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

Questo è basato sugli script del link .

Questo non funziona su Lion.

Qualcuno sa l'equivalente di "assegnare questa app a tutti gli spazi" e "assegnare questa app allo spazio 2" in Lion?

    
posta Ben Williams 29.10.2012 - 05:47
fonte

0 risposte

Leggi altre domande sui tag