Skip to content

Commit

Permalink
Added Preferences
Browse files Browse the repository at this point in the history
Added
toggleFillNewTypeObjectsWithPlaceholderText.js
toggleSelectSameTintPercentage.js
toggleShowCharacterAlternates.js
toggleTransformPatternTiles.js
toggleUsePreviewBounds.js
toggleZoomToSelection.js
toggleZoomWithMouseWheel.js

Updated
generateGradientColor.js
splitText.js
splitTextAtCursorPosition.js

Bug fix
toggleAlignToGlyphBounds.js
togglePasteRemembersLayers.js
toggleShowHandles.js
  • Loading branch information
sky-chaser-high committed Oct 19, 2024
1 parent dcaa577 commit 4a26383
Show file tree
Hide file tree
Showing 37 changed files with 1,461 additions and 200 deletions.
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Change Log

## v1.56.0 (2024-10-19)
- Added Preferences category.
## v1.50.0 (2024-04-06)
- Added View category.
## v1.23.0 (2022-10-28)
Expand Down Expand Up @@ -343,6 +345,9 @@


## generateGradientColor.js
### 1.1.0 (2024-10-19)
### Changes
- When generating a gradient from a path object, the colors are now obtained in order from left to right.
### 1.0.2 (2024-09-16)
### Changes
- Refactoring.
Expand Down Expand Up @@ -689,6 +694,9 @@


## splitText.js
### 1.2.0 (2024-10-19)
### Changes
- Text can now be split even if it is rotated.
### 1.1.0 (2024-04-29)
### Added
- Area types are now supported. After splitting, convert to point types.
Expand All @@ -699,6 +707,13 @@
<br><br>


## splitTextAtCursorPosition.js
### 1.1.0 (2024-10-19)
### Changes
- Text can now be split even if it is rotated.
<br><br>


## stepAndRepeat.js
### 2.1.0 (2024-06-01)
### Added
Expand Down Expand Up @@ -755,6 +770,27 @@
<br><br>


## toggleAlignToGlyphBounds.js
### 1.0.1 (2024-10-19)
### Bug Fixes
- Fixed a bug in which the point text did not toggle in version 2023 or later.
<br><br>


## togglePasteRemembersLayers.js
### 1.0.1 (2024-10-19)
### Bug Fixes
- Fixed a bug in which settings could not toggle when no document is open.
<br><br>


## toggleShowHandles.js
### 1.0.1 (2024-10-19)
### Bug Fixes
- Fixed a bug in which settings could not be changed when no document was open.
<br><br>


## unifyLayerColors.js
### 1.1.0 (2024-08-10)
### Added
Expand Down
239 changes: 184 additions & 55 deletions README.md

Large diffs are not rendered by default.

203 changes: 177 additions & 26 deletions README_ja.md

Large diffs are not rendered by default.

Binary file modified images/copyLine.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/deleteAllRight.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/deleteTrailingSpaces.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/deleteWord.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/emptySelection.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/encloseWordInParentheses.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/goToLine.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/goToText.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/insertLine.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/jumpForward.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/moveLine.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/toggleAlignToGlyphBounds.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/togglePasteRemembersLayers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/toggleSelectSameTintPercentage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/toggleShowCharacterAlternates.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/toggleShowHandles.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/toggleTransformPatternTiles.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/toggleUsePreviewBounds.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/toggleZoomToSelection.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/toggleZoomWithMouseWheel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 37 additions & 19 deletions scripts/generateGradientColor.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
Illustrator CS4 or higher
Version
1.0.2
1.1.0
Homepage
github.com/sky-chaser-high/adobe-illustrator-scripts
Expand All @@ -35,7 +35,9 @@

function main() {
var items = app.activeDocument.selection;
var colors = getColors(items);
var tolerance = 10;
items = sortRow(items, tolerance);
var colors = getColorItems(items);
if (!colors.length) colors = getSwatches();
if (colors.length < 2) return;
createGradient(colors);
Expand Down Expand Up @@ -70,20 +72,20 @@ function createGradient(colors) {
}


function getColors(items) {
function getColorItems(shapes) {
var colors = [];
for (var i = 0; i < items.length; i++) {
var item = items[i];
switch (item.typename) {
for (var i = 0; i < shapes.length; i++) {
var shape = shapes[i];
switch (shape.typename) {
case 'PathItem':
if (!item.filled) continue;
colors = colors.concat(getColorObject(item.fillColor));
if (!shape.filled) continue;
colors = colors.concat(getColorItem(shape.fillColor));
break;
case 'CompoundPathItem':
colors = colors.concat(getColors([item.pathItems[0]]));
colors = colors.concat(getColorItems([shape.pathItems[0]]));
break;
case 'GroupItem':
colors = colors.concat(getColors(item.pageItems));
colors = colors.concat(getColorItems(shape.pageItems));
break;
}
}
Expand All @@ -96,34 +98,46 @@ function getSwatches() {
var swatches = app.activeDocument.swatches.getSelected();
for (var i = 0; i < swatches.length; i++) {
var swatch = swatches[i];
colors = colors.concat(getColorObject(swatch.color));
colors = colors.concat(getColorItem(swatch.color));
}
return colors;
}


function getColorObject(item) {
switch (item.typename) {
function getColorItem(color) {
switch (color.typename) {
case 'CMYKColor':
case 'RGBColor':
case 'GrayColor':
case 'SpotColor':
return [item];
return [color];
case 'GradientColor':
var colors = [];
var gradients = item.gradient.gradientStops;
var gradients = color.gradient.gradientStops;
for (var i = 0; i < gradients.length; i++) {
colors.push(gradients[i].color);
var gradient = gradients[i];
colors.push(gradient.color);
}
return colors;
}
}


function sortRow(items, tolerance) {
return items.sort(function(a, b) {
var distance = Math.abs(b.top - a.top);
if (distance <= tolerance) {
return a.left - b.left;
}
return b.top - a.top;
});
}


function getColorName() {
$.localize = true;
var ui = localizeUI();
var name = 'Gradient';
var name = ui.name;
name = prompt(ui.title, name);
try {
app.activeDocument.swatches[name];
Expand All @@ -139,14 +153,18 @@ function localizeUI() {
title: {
en: 'Enter a gradient name.',
ja: 'グラデーション名を入力してください。'
},
name: {
en: 'Gradient',
ja: 'グラデーション'
}
};
}


function isValidVersion() {
var cs4 = 14;
var aiVersion = parseInt(app.version);
if (aiVersion < cs4) return false;
var current = parseInt(app.version);
if (current < cs4) return false;
return true;
}
Loading

0 comments on commit 4a26383

Please sign in to comment.