El Capitan Anteprima Evidenziatore PDF colore giallo cambiato

2

Originariamente ho aggiornato da OS X Mavericks a El Capitan e quando modifico i file PDF, il mio evidenziatore predefinito è il colore giallo brillante (esempio in basso dell'immagine). Tuttavia, di recente, dopo aver modificato il colore dell'evidenziatore in rosso e di nuovo in giallo, il nuovo colore giallo evidenziato (esempio in alto della stessa immagine) non è più uguale a quello in basso. E non importa quello che faccio, il nuovo evidenziatore giallo non è più luminoso ... basta questo colore di mandarino opaco: (

Come faccio a tornare nuovamente al colore giallo di evidenziazione desiderato?

Grazie

Nota 1: la mia versione corrente di Anteprima è 8.1.877

Nota 2: la schermata è basata sulla brochure APE Building Better Home A530 ...

    
posta Antony 18.12.2015 - 05:49
fonte

1 risposta

1

Qualcuno è stato così gentile da scrivere un codice che avrebbe risolto questo problema.

Sto ripubblicando il codice qui, in modo da poter ottimizzare la soluzione.

//compile with: clang -W -Wall changehighlight.m -framework AppKit
#import <AppKit/AppKit.h>

char cmd[2048];

int main(int argc,char **argv){
    if(argc<3){
        fprintf(stderr,"changehighlight Listname Colorname\nexample: Apple Orange / Crayons Lime\n");
        return 1;
    }
    @autoreleasepool{
        //prepare
        int ver=0;
        {
            int c;
            FILE *funame=popen("uname -r","r");
            for(;~(c=fgetc(funame))&&c!='.';)ver=ver*10+c-'0';
            pclose(funame);
            if(ver<12){
                printf("It looks like you are using Lion or former. This app is useless and might cause unexpected result. Are you sure to continue? [y/N] ");
                c=getchar();
                if(c!='y'&&c!='Y')return 1;
            }
        }

        //get color
        NSColor *color=nil;
        {
            NSString *listname=[NSString stringWithCString:argv[1] encoding:NSUTF8StringEncoding];
            NSString *name=[NSString stringWithCString:argv[2] encoding:NSUTF8StringEncoding];
            for(NSColorList *colorlist in [NSColorList availableColorLists]){
                if([[colorlist name] isEqual:listname]){
                    color=[colorlist colorWithKey:name];
                }
            }
            if(color==nil){
                fprintf(stderr,"color name looks invalid\n");
                return 1;
            }
        }
        NSData *data=[NSArchiver archivedDataWithRootObject:color];
        NSString *desc=[data description];

        //do the hack
        strcpy(cmd,"defaults write \"");
        strcat(cmd,getenv("HOME"));
        if(ver==14){
            // Yosemite
            strcat(cmd,"/Library/Group Containers/com.apple.Preview/Library/Preferences/com.apple.Preview.plist");
        }else if(ver>=11){
            // Lion,Mountain Lion,Mavericks and El Capitan
            strcat(cmd,"/Library/Containers/com.apple.Preview/Data/Library/Preferences/com.apple.Preview.plist");
        }else{
            strcat(cmd,"/Library/Preferences/com.apple.Preview.plist");
        }
        // PVAnnotationColor_8:   highlight
        // PVAnnotationColor_9:   delete line (need to use right click menu)
        // PVAnnotationColor_10:  under line (not functional)
        strcat(cmd,"\" PVAnnotationColor_8 \"");
        strcat(cmd,[desc UTF8String]);
        strcat(cmd,"\"");
        puts(cmd);
        system(cmd);
        system("killall cfprefsd");
        return 0;
    }
}

/*
List of Colors with usual OSX configuration:

Apple Black
Apple Blue
Apple Brown
Apple Cyan
Apple Green
Apple Magenta
Apple Orange
Apple Purple
Apple Red
Apple Yellow
Apple White

Crayons Cantaloupe
Crayons Honeydew
Crayons Spindrift
Crayons Sky
Crayons Lavender
Crayons Carnation
Crayons Licorice
Crayons Snow
Crayons Salmon
Crayons Banana
Crayons Flora
Crayons Ice
Crayons Orchid
Crayons Bubblegum
Crayons Lead
Crayons Mercury
Crayons Tangerine
Crayons Lime
Crayons Sea Foam
Crayons Aqua
Crayons Grape
Crayons Strawberry
Crayons Tungsten
Crayons Silver
Crayons Maraschino
Crayons Lemon
Crayons Spring
Crayons Turquoise
Crayons Blueberry
Crayons Magenta
Crayons Iron
Crayons Magnesium
Crayons Mocha
Crayons Fern
Crayons Moss
Crayons Ocean
Crayons Eggplant
Crayons Maroon
Crayons Steel
Crayons Aluminum
Crayons Cayenne
Crayons Asparagus
Crayons Clover
Crayons Teal
Crayons Midnight
Crayons Plum
Crayons Tin
Crayons Nickel

"Web Safe Colors" 003366
"Web Safe Colors" 99CCFF
bla bla...

System alternateSelectedControlColor
System alternateSelectedControlTextColor
System controlBackgroundColor
System controlColor
System controlDarkShadowColor
System controlHighlightColor
System controlLightHighlightColor
System controlShadowColor
System controlTextColor
System disabledControlTextColor
System gridColor
System headerColor
System headerTextColor
System highlightColor
System keyboardFocusIndicatorColor
System knobColor
System labelColor
System quaternaryLabelColor
System scrollBarColor
System secondaryLabelColor
System secondarySelectedControlColor
System selectedControlColor
System selectedControlTextColor
System selectedKnobColor
System selectedMenuItemColor
System selectedMenuItemTextColor
System selectedTextBackgroundColor
System selectedTextColor
System shadowColor
System tertiaryLabelColor
System textBackgroundColor
System textColor
System windowBackgroundColor
System windowFrameColor
System windowFrameTextColor
*/

Salva il codice come changehighlight.m

Apri un terminale, cerca la stessa directory in cui hai salvato il file e invia il comando clang -W -Wall changehighlight.m -framework AppKit && mv a.out changehighlight

Per ripristinare il colore, invia il comando ./changehighlight Apple Yellow

    
risposta data 21.12.2015 - 05:48
fonte

Leggi altre domande sui tag