Community-Einsteiger
,
/t5/illustrator-discussions/scripting-colour-value-rgb-to-clipboard/td-p/11765237
Jan 19, 2021
Jan 19, 2021
Link in Zwischenablage kopieren
Kopiert
Hi guys,
Is there an script option to copy a colour value of a selected object to clipboard? I have stumbled upon some script snippets all accross the Interweb; however, I wasn't able to find a full, working .jsx file to use as script. The best I have found was an option of exporting the swatches' values to a txt file, nevertheless, this didn't work for me as there were plenty of colour in the file and I'd lose track of which is which.
Simply selecting the object, running the script and ending up with three numbers in the Clipboard would be sufficient.
Thanks!
THEMEN
Skripterstellung
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten.
Weitere Informationen
1 richtige Antwort
Ratgeber
,
Jan 19, 2021
Jan 19, 2021
if (app.selection.length != 1 || app.selection[0].typename != "PathItem") {
alert( "Select one pathItem." );
} else if (app.selection[0].fillColor.typename != "RGBColor") {
alert( "Color is not RGB." );
} else {
var AR = app.activeDocument.artboards[0].artboardRect;
var rect1 = app.activeDocument.pathItems.rectangle(0, AR[2]-100, 100, 100);
var R = Math.round(app.selection[0].fillColor.red),
G = Math.round(app.selection[0].fillColor.green),
B = Math.round(app.sele
...
Entdecken Sie verwandte Tutorials und Artikel
Ratgeber
,
/t5/illustrator-discussions/scripting-colour-value-rgb-to-clipboard/m-p/11766550#M260294
Jan 19, 2021
Jan 19, 2021
Link in Zwischenablage kopieren
Kopiert
if (app.selection.length != 1 || app.selection[0].typename != "PathItem") {
alert( "Select one pathItem." );
} else if (app.selection[0].fillColor.typename != "RGBColor") {
alert( "Color is not RGB." );
} else {
var AR = app.activeDocument.artboards[0].artboardRect;
var rect1 = app.activeDocument.pathItems.rectangle(0, AR[2]-100, 100, 100);
var R = Math.round(app.selection[0].fillColor.red),
G = Math.round(app.selection[0].fillColor.green),
B = Math.round(app.selection[0].fillColor.blue);
var text0 = app.activeDocument.textFrames.areaText(rect1);
text0.contents = R + ", " + G + ", " + B;
app.selection = null;
app.activeDocument.pageItems[0].selected = true;
app.cut();
};
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten.
Weitere Informationen
pavlonjablon
AUTOR
Community-Einsteiger
,
AKTUELL
/t5/illustrator-discussions/scripting-colour-value-rgb-to-clipboard/m-p/11768274#M260377
Jan 20, 2021
Jan 20, 2021
Link in Zwischenablage kopieren
Kopiert
Thanks so much, @femkeblanco !
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten.
Weitere Informationen

