diff --git a/CHANGELOG.md b/CHANGELOG.md
index bbc14a3..17fa10c 100755
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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)
@@ -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.
@@ -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.
@@ -699,6 +707,13 @@
+## splitTextAtCursorPosition.js
+### 1.1.0 (2024-10-19)
+### Changes
+- Text can now be split even if it is rotated.
+
+
+
## stepAndRepeat.js
### 2.1.0 (2024-06-01)
### Added
@@ -755,6 +770,27 @@
+## 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.
+
+
+
+## togglePasteRemembersLayers.js
+### 1.0.1 (2024-10-19)
+### Bug Fixes
+- Fixed a bug in which settings could not toggle when no document is open.
+
+
+
+## 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.
+
+
+
## unifyLayerColors.js
### 1.1.0 (2024-08-10)
### Added
diff --git a/README.md b/README.md
index 5f83317..151a6e8 100755
--- a/README.md
+++ b/README.md
@@ -17,17 +17,16 @@ If you find a script that interests you, please download it from [![Download](ht
### Color
[![Download Color.zip](https://img.shields.io/badge/Download-Color.zip-e60012)](https://github.com/sky-chaser-high/adobe-illustrator-scripts/releases/latest/download/Color.zip)
- [Add Selected Gradients to Swatch](#addSelectedGradientsToSwatchjs)
-- [Convert to Global Color](#convertToGlobalColorjsconvertToSpotColorjs)
-- [Convert to Spot Color](#convertToGlobalColorjsconvertToSpotColorjs)
-- [Create Color Chart](#createColorChartjs) `Update`
+- [Convert to Global / Spot Color](#convertToGlobalColorjsconvertToSpotColorjs)
+- [Create Color Chart](#createColorChartjs)
- [Delete All Swatches](#deleteAllSwatchesjs)
- [Export Color Values to CSV](#exportColorValuesToCSVjs)
- [Extract Colors from Gradient](#extractColorsFromGradientjs)
-- [Generate Gradient Color](#generateGradientColorjs)
-- [Highlight Word](#highlightWordjs) `Update`
+- [Generate Gradient Color](#generateGradientColorjs) `Update`
+- [Highlight Word](#highlightWordjs)
- [Import CSV to Swatch](#importCSVtoSwatchjs)
- [Match Location of Gradient Stop](#matchLocationOfGradientStopjs)
-- [Random Text Color](#randomTextColorjs) `Update`
+- [Random Text Color](#randomTextColorjs)
- [Remove Deleted Global Color](#removeDeletedGlobalColorjs)
- [Round Color Value](#roundColorValuejs)
- [Round Location of Gradient Stop](#roundLocationOfGradientStopjs)
@@ -47,9 +46,9 @@ If you find a script that interests you, please download it from [![Download](ht
### Link
[![Download Link.zip](https://img.shields.io/badge/Download-Link.zip-e60012)](https://github.com/sky-chaser-high/adobe-illustrator-scripts/releases/latest/download/Link.zip)
-- [Bulk Relink](#bulkRelinkjs) `New`
+- [Bulk Relink](#bulkRelinkjs)
- [Relink File Extension](#relinkFileExtensionjs)
-- [Relink File Extension Extra](#relinkFileExtensionExtrajs) `Bug Fix`
+- [Relink File Extension Extra](#relinkFileExtensionExtrajs)
- [Relink to Folder](#relinkToFolderjs)
- [Rename Linked File](#renameLinkedFilejs)
- [Reset to Full Scale](#resetToFullScalejs)
@@ -59,17 +58,14 @@ If you find a script that interests you, please download it from [![Download](ht
### Path
[![Download Path.zip](https://img.shields.io/badge/Download-Path.zip-e60012)](https://github.com/sky-chaser-high/adobe-illustrator-scripts/releases/latest/download/Path.zip)
- [Add Anchor Points](#addAnchorPointsjs)
-- [Align in Center of Space (Horizontal)](#alignInCenterOfSpaceHorizontaljsalignInCenterOfSpaceVerticaljs)
-- [Align in Center of Space (Vertical)](#alignInCenterOfSpaceHorizontaljsalignInCenterOfSpaceVerticaljs)
+- [Align in Center of Space](#alignInCenterOfSpaceHorizontaljsalignInCenterOfSpaceVerticaljs)
- [Align Objects](#alignObjectsjs)
- [Close Path](#closePathjs)
- [Convert All Anchor Points to Corner](#convertAllAnchorPointsToCornerjs)
- [Create Grid Lines](#createGridLinesjs)
-- [Decrease Selected Anchor Points Clockwise](#decreaseSelectedAnchorPointsCWjsdecreaseSelectedAnchorPointsCCWjs)
-- [Decrease Selected Anchor Points Counterclockwise](#decreaseSelectedAnchorPointsCWjsdecreaseSelectedAnchorPointsCCWjs)
+- [Decrease Selected Anchor Points](#decreaseSelectedAnchorPointsCWjsdecreaseSelectedAnchorPointsCCWjs)
- [Disjoin Path](#disjoinPathjs)
-- [Distribute in Space (Horizontal)](#distributeInSpaceHorizontaljsdistributeInSpaceVerticaljs)
-- [Distribute in Space (Vertical)](#distributeInSpaceHorizontaljsdistributeInSpaceVerticaljs)
+- [Distribute in Space](#distributeInSpaceHorizontaljsdistributeInSpaceVerticaljs)
- [Draw Circumscribed Circle](#drawCircumscribedCirclejs)
- [Draw Normal Line](#drawNormalLinejs)
- [Draw Rectangle](#drawRectanglejs)
@@ -78,14 +74,12 @@ If you find a script that interests you, please download it from [![Download](ht
- [Extend Handle](#extendHandlejs)
- [Extend Line](#extendLinejs)
- [Fit Guide in Artboard](#fitGuideInArtboardjs)
-- [Increase Selected Anchor Points Clockwise](#increaseSelectedAnchorPointsCWjsincreaseSelectedAnchorPointsCCWjs)
-- [Increase Selected Anchor Points Counterclockwise](#increaseSelectedAnchorPointsCWjsincreaseSelectedAnchorPointsCCWjs)
+- [Increase Selected Anchor Points](#increaseSelectedAnchorPointsCWjsincreaseSelectedAnchorPointsCCWjs)
- [Move Guides](#moveGuidesjs)
- [Rearrange Objects](#rearrangeObjectsjs)
- [Remove Color in Guide Object](#removeColorInGuideObjectjs)
- [Select Guides](#selectGuidesjs)
-- [Shift Selected Anchor Points Clockwise](#shiftSelectedAnchorPointsCWjsshiftSelectedAnchorPointsCCWjs)
-- [Shift Selected Anchor Points Counterclockwise](#shiftSelectedAnchorPointsCWjsshiftSelectedAnchorPointsCCWjs)
+- [Shift Selected Anchor Points](#shiftSelectedAnchorPointsCWjsshiftSelectedAnchorPointsCCWjs)
- [Show Dimensions](#showDimensionsjs)
- [Shuffle Objects](#shuffleObjectsjs)
- [Step and Repeat](#stepAndRepeatjs)
@@ -94,33 +88,25 @@ If you find a script that interests you, please download it from [![Download](ht
[![Download Text.zip](https://img.shields.io/badge/Download-Text.zip-e60012)](https://github.com/sky-chaser-high/adobe-illustrator-scripts/releases/latest/download/Text.zip)
- [Add Numeric Separators](#addNumericSeparatorsjs)
- [Convert Type on a Path to Point Type](#convertTypeOnAPathToPointTypejs)
-- [Copy Line Down](#copyLineDownjscopyLineUpjs)
-- [Copy Line Up](#copyLineDownjscopyLineUpjs)
-- [Copy Line (empty selection)](#copyLineEmptySelectionjscutLineEmptySelectionjs)
+- [Copy Line Up / Down](#copyLineDownjscopyLineUpjs)
+- [Copy / Cut Line (empty selection)](#copyLineEmptySelectionjscutLineEmptySelectionjs)
- [Create Page Numbers](#createPageNumbersjs)
- [Create Text Parallel to Path Segment](#createTextParallelToPathSegmentjs)
- [Create Threaded Text](#createThreadedTextjs)
-- [Cut Line (empty selection)](#copyLineEmptySelectionjscutLineEmptySelectionjs)
-- [Delete All Left](#deleteAllLeftjsdeleteAllRightjs)
-- [Delete All Right](#deleteAllLeftjsdeleteAllRightjs)
+- [Delete All Left / Right](#deleteAllLeftjsdeleteAllRightjs)
- [Delete Trailing Spaces](#deleteTrailingSpacesjs)
- [Delete Word](#deleteWordjs)
- [Enclose Word in Parentheses](#encloseWordInParenthesesjs)
- [Go to Line](#goToLinejs)
-- [Go to Next Text](#goToNextTextjsgoToPreviousTextjs)
-- [Go to Previous Text](#goToNextTextjsgoToPreviousTextjs)
-- [Insert Line Above](#insertLineAbovejsinsertLineBelowjs)
-- [Insert Line Below](#insertLineAbovejsinsertLineBelowjs)
+- [Go to Next / Previous Text](#goToNextTextjsgoToPreviousTextjs)
+- [Insert Line Above / Below](#insertLineAbovejsinsertLineBelowjs)
- [Justify Content Space Between](#justifyContentSpaceBetweenjs)
-- [Move Line Down](#moveLineDownjsmoveLineUpjs)
-- [Move Line Up](#moveLineDownjsmoveLineUpjs)
+- [Move Line Up / Down](#moveLineDownjsmoveLineUpjs)
- [Sort Lines](#sortLinesjs)
-- [Split Text](#splitTextjs)
-- [Split Text at Cursor Position](#splitTextAtCursorPositionjs)
+- [Split Text](#splitTextjs) `Update`
+- [Split Text at Cursor Position](#splitTextAtCursorPositionjs) `Update`
- [Swap Text Contents](#swapTextContentsjs)
-- [Text Align Center](#textAlign_CenterjstextAlign_LeftjstextAlign_Rightjs)
-- [Text Align Left](#textAlign_CenterjstextAlign_LeftjstextAlign_Rightjs)
-- [Text Align Right](#textAlign_CenterjstextAlign_LeftjstextAlign_Rightjs)
+- [Text Align Left / Center / Right](#textAlign_CenterjstextAlign_LeftjstextAlign_Rightjs)
### Utility
[![Download Utility.zip](https://img.shields.io/badge/Download-Utility.zip-e60012)](https://github.com/sky-chaser-high/adobe-illustrator-scripts/releases/latest/download/Utility.zip)
@@ -129,20 +115,27 @@ If you find a script that interests you, please download it from [![Download](ht
- [Compare Scale](#compareScalejs)
- [Measure Distance](#measureDistancejs)
- [Sum Numbers](#sumNumbersjs)
-- [Toggle Align to Glyph Bounds](#toggleAlignToGlyphBoundsjs)
-- [Toggle Paste Remembers Layers](#togglePasteRemembersLayersjs)
-- [Toggle Show Handles](#toggleShowHandlesjs)
- [Unit Calculator](#unitCalculatorjs)
### View
[![Download View.zip](https://img.shields.io/badge/Download-View.zip-e60012)](https://github.com/sky-chaser-high/adobe-illustrator-scripts/releases/latest/download/View.zip)
- [Arrange Windows](#arrangeWindowsjs)
- [Fit Selected Objects in Window](#fitSelectedObjectsInWindowjs)
-- [Navigate to First Artboard](#navigateToFirstArtboardjsnavigateToLastArtboardjsnavigateToNextArtboardjsnavigateToPreviousArtboardjs)
-- [Navigate to Last Artboard](#navigateToFirstArtboardjsnavigateToLastArtboardjsnavigateToNextArtboardjsnavigateToPreviousArtboardjs)
-- [Navigate to Next Artboard](#navigateToFirstArtboardjsnavigateToLastArtboardjsnavigateToNextArtboardjsnavigateToPreviousArtboardjs)
-- [Navigate to Previous Artboard](#navigateToFirstArtboardjsnavigateToLastArtboardjsnavigateToNextArtboardjsnavigateToPreviousArtboardjs)
+- [Navigate to First / Last / Next / Previous Artboard](#navigateToFirstArtboardjsnavigateToLastArtboardjsnavigateToNextArtboardjsnavigateToPreviousArtboardjs)
- [Sync View](#syncViewjs)
+
+### Preferences
+[![Download Preferences.zip](https://img.shields.io/badge/Download-Preferences.zip-e60012)](https://github.com/sky-chaser-high/adobe-illustrator-scripts/releases/latest/download/Preferences.zip)
+- [Align to Glyph Bounds](#toggleAlignToGlyphBoundsjs) `Bug Fix`
+- [Fill New Type Objects With Placeholder Text](#toggleFillNewTypeObjectsWithPlaceholderTextjs) `New`
+- [Paste Remembers Layers](#togglePasteRemembersLayersjs)
+- [Select Same Tint Percentage](#toggleSelectSameTintPercentagejs) `New`
+- [Show Character Alternates](#toggleShowCharacterAlternatesjs) `New`
+- [Show Handles](#toggleShowHandlesjs)
+- [Transform Pattern Tiles](#toggleTransformPatternTilesjs) `New`
+- [Use Preview Bounds](#toggleUsePreviewBoundsjs) `New`
+- [Zoom to Selection](#toggleZoomToSelectionjs) `New`
+- [Zoom with Mouse Wheel](#toggleZoomWithMouseWheeljs) `New`
@@ -447,7 +440,7 @@ Point, Pixel, Pica, Inch, Feet, Yard, Millimeter, Centimeter, Meter.
These units depend on the ruler units.
### Requirements
-Illustrator CS4 or higher
+Illustrator CC or higher
@@ -541,7 +534,7 @@ If you assign shortcuts using [Keyboard Maestro](https://www.keyboardmaestro.com
you will be able to achieve more of a Visual Studio Code feel.
Both point and area types are supported.
-![Vscode Copy Line](images/vscode_copyLine.png)
+
For example, copyLineDown.js:
![Copy Line](images/copyLine.png)
@@ -1327,6 +1320,9 @@ Illustrator CS or higher
[![Download Color.zip](https://img.shields.io/badge/Download-Color.zip-e60012)](https://github.com/sky-chaser-high/adobe-illustrator-scripts/releases/latest/download/Color.zip)
This script generates a gradient color from fill colors or swatches.
+> [!TIP]
+> It has been implement in the Swatch panel menu since version 2025.
+
![Generate Gradient Color](images/generateGradientColor.png)
### Usage
@@ -1354,7 +1350,7 @@ If you assign shortcuts using [Keyboard Maestro](https://www.keyboardmaestro.com
you will be able to achieve more of a Visual Studio Code feel.
Both point and area types are supported.
-![Vscode Go to Line](images/vscode_goToLine.png)
+
![Go to Line](images/goToLine.png)
@@ -1693,7 +1689,7 @@ If you assign shortcuts using [Keyboard Maestro](https://www.keyboardmaestro.com
you will be able to achieve more of a Visual Studio Code feel.
Both point and area types are supported.
-![Vscode Move Line](images/vscode_moveLine.png)
+
For example, moveLineDown.js:
![Move Line](images/moveLine.png)
@@ -2408,7 +2404,7 @@ This script splits a text by lines, words, or characters. The vertical text is a
> After splitting, the text position may move slightly.
### Requirements
-Illustrator CS4 or higher
+Illustrator CC or higher
@@ -2552,10 +2548,10 @@ Illustrator CS or higher
# toggleAlignToGlyphBounds.js
-[![Download Utility.zip](https://img.shields.io/badge/Download-Utility.zip-e60012)](https://github.com/sky-chaser-high/adobe-illustrator-scripts/releases/latest/download/Utility.zip)
+[![Download Preferences.zip](https://img.shields.io/badge/Download-Preferences.zip-e60012)](https://github.com/sky-chaser-high/adobe-illustrator-scripts/releases/latest/download/Preferences.zip)
This script toggles the Align panel menu > Align to Glyph Bounds > Point Text and Area Text.
-![Toggle Align To Glyph Bounds](images/toggleAlignToGlyphBounds.png)
+![Toggle Align to Glyph Bounds](images/toggleAlignToGlyphBounds.png)
### Usage
Just run this script.
@@ -2563,7 +2559,26 @@ Just run this script.
### Requirements
Illustrator 2020 or higher
-
+
+
+
+
+
+
+
+# toggleFillNewTypeObjectsWithPlaceholderText.js
+[![Download Preferences.zip](https://img.shields.io/badge/Download-Preferences.zip-e60012)](https://github.com/sky-chaser-high/adobe-illustrator-scripts/releases/latest/download/Preferences.zip)
+This script toggles the Preferences > Type > Fill New Type Objects With Placeholder Text.
+
+
+
+### Usage
+Just run this script.
+
+### Requirements
+Illustrator 2018 or higher
+
+
@@ -2571,7 +2586,7 @@ Illustrator 2020 or higher
# togglePasteRemembersLayers.js
-[![Download Utility.zip](https://img.shields.io/badge/Download-Utility.zip-e60012)](https://github.com/sky-chaser-high/adobe-illustrator-scripts/releases/latest/download/Utility.zip)
+[![Download Preferences.zip](https://img.shields.io/badge/Download-Preferences.zip-e60012)](https://github.com/sky-chaser-high/adobe-illustrator-scripts/releases/latest/download/Preferences.zip)
This script toggles the Layers panel menu > Paste Remembers Layers.
![Toggle Paste Remembers Layers](images/togglePasteRemembersLayers.png)
@@ -2582,7 +2597,45 @@ Just run this script.
### Requirements
Illustrator CC or higher
-
+
+
+
+
+
+
+
+# toggleSelectSameTintPercentage.js
+[![Download Preferences.zip](https://img.shields.io/badge/Download-Preferences.zip-e60012)](https://github.com/sky-chaser-high/adobe-illustrator-scripts/releases/latest/download/Preferences.zip)
+This script toggles the Preferences > General > Select Same Tint %.
+
+
+
+### Usage
+Just run this script.
+
+### Requirements
+Illustrator CC or higher
+
+
+
+
+
+
+
+
+# toggleShowCharacterAlternates.js
+[![Download Preferences.zip](https://img.shields.io/badge/Download-Preferences.zip-e60012)](https://github.com/sky-chaser-high/adobe-illustrator-scripts/releases/latest/download/Preferences.zip)
+This script toggles the Preferences > Type > Show Character Alternates.
+
+
+
+### Usage
+Just run this script.
+
+### Requirements
+Illustrator 2020 or higher
+
+
@@ -2590,10 +2643,10 @@ Illustrator CC or higher
# toggleShowHandles.js
-[![Download Utility.zip](https://img.shields.io/badge/Download-Utility.zip-e60012)](https://github.com/sky-chaser-high/adobe-illustrator-scripts/releases/latest/download/Utility.zip)
+[![Download Preferences.zip](https://img.shields.io/badge/Download-Preferences.zip-e60012)](https://github.com/sky-chaser-high/adobe-illustrator-scripts/releases/latest/download/Preferences.zip)
This script toggles the Preferences > Selection & Anchor Display > Anchor Points, Handle, and Bounding Box Display > Show handles when multiple anchors are selected.
-![Toggle Show Handles](images/toggleShowHandles.png)
+
### Usage
Just run this script.
@@ -2601,7 +2654,83 @@ Just run this script.
### Requirements
Illustrator CC or higher
-
+
+
+
+
+
+
+
+# toggleTransformPatternTiles.js
+[![Download Preferences.zip](https://img.shields.io/badge/Download-Preferences.zip-e60012)](https://github.com/sky-chaser-high/adobe-illustrator-scripts/releases/latest/download/Preferences.zip)
+This script toggles the Preferences > General > Transform Pattern Tiles.
+
+
+
+### Usage
+Just run this script.
+
+### Requirements
+Illustrator CC or higher
+
+
+
+
+
+
+
+
+# toggleUsePreviewBounds.js
+[![Download Preferences.zip](https://img.shields.io/badge/Download-Preferences.zip-e60012)](https://github.com/sky-chaser-high/adobe-illustrator-scripts/releases/latest/download/Preferences.zip)
+This script toggles the Align panel menu > Use Preview Bounds or the Preferences > General > Use Preview Bounds.
+
+
+
+### Usage
+Just run this script.
+
+### Requirements
+Illustrator CC or higher
+
+
+
+
+
+
+
+
+# toggleZoomToSelection.js
+[![Download Preferences.zip](https://img.shields.io/badge/Download-Preferences.zip-e60012)](https://github.com/sky-chaser-high/adobe-illustrator-scripts/releases/latest/download/Preferences.zip)
+This script toggles the Preferences > Selection & Anchor Display > Selection > Zoom to Selection.
+
+
+
+### Usage
+Just run this script.
+
+### Requirements
+Illustrator 2018 or higher
+
+
+
+
+
+
+
+
+# toggleZoomWithMouseWheel.js
+[![Download Preferences.zip](https://img.shields.io/badge/Download-Preferences.zip-e60012)](https://github.com/sky-chaser-high/adobe-illustrator-scripts/releases/latest/download/Preferences.zip)
+This script toggles the Preferences > General > Zoom with Mouse Wheel.
+
+
+
+### Usage
+Just run this script.
+
+### Requirements
+Illustrator 2022 or higher
+
+
diff --git a/README_ja.md b/README_ja.md
index 1d632f3..192ede3 100755
--- a/README_ja.md
+++ b/README_ja.md
@@ -19,17 +19,17 @@ Adobe Illustratorのスクリプト集です。
- [**カラー数値をCSVファイルに保存**](#カラー数値をCSVファイルに保存) exportColorValuesToCSV.js
- [**カラー数値を四捨五入**](#カラー数値を四捨五入) roundColorValue.js
- [**カラー数値を表示**](#カラー数値を表示) showColorValues.js
-- [**カラーチャートを作成**](#カラーチャートを作成) createColorChart.js `Update`
+- [**カラーチャートを作成**](#カラーチャートを作成) createColorChart.js
- [**グラデーションのカラー分岐点から色を取り出す**](#グラデーションのカラー分岐点から色を取り出す) extractColorsFromGradient.js
- [**グラデーションのカラー分岐・中間点の位置を同期**](#グラデーションのカラー分岐中間点の位置を同期) matchLocationOfGradientStop.js
- [**グラデーションのカラー分岐・中間点の数値を四捨五入**](#グラデーションのカラー分岐中間点の数値を四捨五入) roundLocationOfGradientStop.js
- [**グラデーションをシャッフル**](#グラデーションをシャッフル) shuffleGradientColor.js
- [**グラデーションをスウォッチに追加**](#グラデーションをスウォッチに追加) addSelectedGradientsToSwatch.js
-- [**グラデーションを生成**](#グラデーションを生成) generateGradientColor.js
+- [**グラデーションを生成**](#グラデーションを生成) generateGradientColor.js `Update`
- [**グローバルカラーに変換**](#グローバルカラーに変換特色に変換) convertToGlobalColor.js
- [**すべてのスウォッチを削除**](#すべてのスウォッチを削除) deleteAllSwatches.js
-- [**テキストの色を変更**](#テキストの色を変更) highlightWord.js `Update`
-- [**テキストの色をランダムに変更**](#テキストの色をランダムに変更) randomTextColor.js `Update`
+- [**テキストの色を変更**](#テキストの色を変更) highlightWord.js
+- [**テキストの色をランダムに変更**](#テキストの色をランダムに変更) randomTextColor.js
- [**特色に変換**](#グローバルカラーに変換特色に変換) convertToSpotColor.js
### レイヤー
@@ -47,9 +47,9 @@ Adobe Illustratorのスクリプト集です。
[![Download Link.zip](https://img.shields.io/badge/Download-Link.zip-e60012?style=for-the-badge)](https://github.com/sky-chaser-high/adobe-illustrator-scripts/releases/latest/download/Link.zip)
- [**埋め込み画像を選択**](#埋め込み画像を選択) selectEmbeddedLink.js
- [**ファイル拡張子にリンクを再設定**](#ファイル拡張子にリンクを再設定) relinkFileExtension.js
-- [**ファイル拡張子にリンクを再設定(機能拡張版)**](#ファイル拡張子にリンクを再設定機能拡張版) relinkFileExtensionExtra.js `Bug Fix`
+- [**ファイル拡張子にリンクを再設定(機能拡張版)**](#ファイル拡張子にリンクを再設定機能拡張版) relinkFileExtensionExtra.js
- [**フォルダに再リンク**](#フォルダに再リンク) relinkToFolder.js
-- [**まとめてリンクを再設定**](#まとめてリンクを再設定) bulkRelink.js `New`
+- [**まとめてリンクを再設定**](#まとめてリンクを再設定) bulkRelink.js
- [**リンク画像の名前を変更**](#リンク画像の名前を変更) renameLinkedFile.js
- [**リンク画像を原寸サイズに戻す**](#リンク画像を原寸サイズに戻す) resetToFullScale.js
- [**リンク画像を選択**](#リンク画像を選択) selectLink.js
@@ -116,18 +116,15 @@ Adobe Illustratorのスクリプト集です。
- [**ノンブルを作成**](#ノンブルを作成) createPageNumbers.ja
- [**パス上文字をポイント文字に切り替え**](#パス上文字をポイント文字に切り替え) convertTypeOnAPathToPointType.js
- [**文字列を括弧で囲む**](#文字列を括弧で囲む) encloseWordInParentheses.js
-- [**文字列をカーソルの位置で分割**](#文字列をカーソルの位置で分割) splitTextAtCursorPosition.js
+- [**文字列をカーソルの位置で分割**](#文字列をカーソルの位置で分割) splitTextAtCursorPosition.js `Update`
- [**文字列を交換**](#文字列を交換) swapTextContents.js
-- [**文字列を分割**](#文字列を分割) splitText.js
+- [**文字列を分割**](#文字列を分割) splitText.js `Update`
### ユーティリティ
[![Download Utility.zip](https://img.shields.io/badge/Download-Utility.zip-e60012?style=for-the-badge)](https://github.com/sky-chaser-high/adobe-illustrator-scripts/releases/latest/download/Utility.zip)
- [**拡大・縮小率の確認**](#拡大縮小率の確認) compareScale.js
- [**距離の測定**](#距離の測定) measureDistance.js
-- [**コピー元のレイヤーにペーストを切り替える**](#コピー元のレイヤーにペーストを切り替える) togglePasteRemembersLayers.js
-- [**字形の境界に整列を切り替える**](#字形の境界に整列を切り替える) toggleAlignToGlyphBounds.js
- [**すべてのドキュメントを閉じる**](#すべてのドキュメントを閉じる) closeAllDocuments.js
-- [**選択した複数のアンカーポイントのハンドルを表示/隠すを切り替える**](#選択した複数のアンカーポイントのハンドルを表示隠すを切り替える) toggleShowHandles.js
- [**単位を換算**](#単位を換算) unitCalculator.js
- [**日付と曜日の確認**](#日付と曜日の確認) checkDayOfWeek.js
- [**文字列内の数字の合計**](#文字列内の数字の合計) sumNumbers.js
@@ -141,6 +138,19 @@ Adobe Illustratorのスクリプト集です。
- [**先頭のアートボードへ移動**](#最後のアートボードへ移動先頭のアートボードへ移動次のアートボードへ移動前のアートボードへ移動) navigateToFirstArtboard.js
- [**次のアートボードへ移動**](#最後のアートボードへ移動先頭のアートボードへ移動次のアートボードへ移動前のアートボードへ移動) navigateToNextArtboard.js
- [**前のアートボードへ移動**](#最後のアートボードへ移動先頭のアートボードへ移動次のアートボードへ移動前のアートボードへ移動) navigateToPreviousArtboard.js
+
+### 環境設定
+[![Download Preferences.zip](https://img.shields.io/badge/Download-Preferences.zip-e60012?style=for-the-badge)](https://github.com/sky-chaser-high/adobe-illustrator-scripts/releases/latest/download/Preferences.zip)
+- [**同じ濃度を選択**](#同じ濃度を選択) toggleSelectSameTintPercentage.js `New`
+- [**コピー元のレイヤーにペースト**](#コピー元のレイヤーにペースト) togglePasteRemembersLayers.js
+- [**字形の境界に整列**](#字形の境界に整列) toggleAlignToGlyphBounds.js `Bug Fix`
+- [**新規テキストオブジェクトにサンプルテキストを割り付け**](#新規テキストオブジェクトにサンプルテキストを割り付け) toggleFillNewTypeObjectsWithPlaceholderText.js `New`
+- [**選択された文字の異体字を表示**](#選択された文字の異体字を表示) toggleShowCharacterAlternates.js `New`
+- [**選択範囲へズーム**](#選択範囲へズーム) toggleZoomToSelection.js `New`
+- [**パターンを変形**](#パターンを変形) toggleTransformPatternTiles.js `New`
+- [**複数アンカーを選択時にハンドルを表示**](#複数アンカーを選択時にハンドルを表示) toggleShowHandles.js
+- [**プレビュー境界を使用**](#プレビュー境界を使用) toggleUsePreviewBounds.js `New`
+- [**マウスホイールでズーム**](#マウスホイールでズーム) toggleZoomWithMouseWheel.js `New`
@@ -479,7 +489,7 @@ Illustrator CS以降
使用する単位は、定規の単位によります。
#### 動作条件
-Illustrator CS4以降
+Illustrator CC以降
@@ -579,7 +589,7 @@ Visual Studio Code の「行を上へコピー」( Option / Alt<
などでショートカットを割り当てると、より一層Visual Studio Codeの操作感が出せると思います。
ポイント文字、エリア内文字のどちらにも対応しています。
-![Vscode Copy Line](images/vscode_copyLine.png)
+
例 copyLineDown.js:
![Copy Line](images/copyLine.png)
@@ -1420,6 +1430,9 @@ Illustrator CS以降
### generateGradientColor.js
オブジェクトの塗り色またはスウォッチからグラデーションを生成します。
+> [!TIP]
+> バージョン2025からスウォッチパネルメニューに実装されています。
+
![Generate Gradient Color](images/generateGradientColor.png)
#### 使用方法
@@ -1449,7 +1462,7 @@ Visual Studio Code の「行/列に移動」( Ctrl + G )
などでショートカットを割り当てると、より一層Visual Studio Codeの操作感が出せると思います。
ポイント文字、エリア内文字のどちらにも対応しています。
-![Vscode Go to Line](images/vscode_goToLine.png)
+
![Go to Line](images/goToLine.png)
> [!NOTE]
@@ -1813,7 +1826,7 @@ Visual Studio Code の「行を上へ移動」( Option / Alt
例 moveLineDown.js:
![Move Line](images/moveLine.png)
@@ -2037,8 +2050,6 @@ Illustrator CS6以降
### relinkToFolder.js
リンク画像を選択したフォルダにある同じ名前のファイルと置き換えます。InDesignの「リンクパネル > フォルダに再リンク」に相当します。
-
-
#### 使用方法
1. 再設定したいリンク画像を選択しスクリプトを実行します。
なにも選択しない場合は、ドキュメント内のすべてのリンク画像が対象になります。
@@ -2583,7 +2594,7 @@ Illustrator CS4以降
> 分割後、テキストの位置がわずかに移動することがあります。
#### 動作条件
-Illustrator CS4以降
+Illustrator CC以降
@@ -2739,7 +2750,7 @@ Illustrator CS以降
-## 字形の境界に整列を切り替える
+## 字形の境界に整列
[![Download Utility.zip](https://img.shields.io/badge/Download-Utility.zip-e60012)](https://github.com/sky-chaser-high/adobe-illustrator-scripts/releases/latest/download/Utility.zip)
### toggleAlignToGlyphBounds.js
「整列パネル > 字形の境界に整列 > ポイント文字・エリア内文字」のオン/オフを両方同時に切り替えます。
@@ -2752,14 +2763,34 @@ Illustrator CS以降
#### 動作条件
Illustrator 2020以降
-
+
-## コピー元のレイヤーにペーストを切り替える
+## 新規テキストオブジェクトにサンプルテキストを割り付け
+[![Download Utility.zip](https://img.shields.io/badge/Download-Utility.zip-e60012)](https://github.com/sky-chaser-high/adobe-illustrator-scripts/releases/latest/download/Utility.zip)
+### toggleFillNewTypeObjectsWithPlaceholderText.js
+「環境設定 > テキスト > 新規テキストオブジェクトにサンプルテキストを割り付け」のオン/オフを切り替えます。
+
+
+
+#### 使用方法
+このスクリプトを実行するだけです。
+
+#### 動作条件
+Illustrator 2018以降
+
+
+
+
+
+
+
+
+## コピー元のレイヤーにペースト
[![Download Utility.zip](https://img.shields.io/badge/Download-Utility.zip-e60012)](https://github.com/sky-chaser-high/adobe-illustrator-scripts/releases/latest/download/Utility.zip)
### togglePasteRemembersLayers.js
「レイヤーパネル > コピー元のレイヤーにペースト」のオン/オフを切り替えます。
@@ -2772,19 +2803,59 @@ Illustrator 2020以降
#### 動作条件
Illustrator CC以降
-
+
-## 選択した複数のアンカーポイントのハンドルを表示/隠すを切り替える
+## 同じ濃度を選択
+[![Download Utility.zip](https://img.shields.io/badge/Download-Utility.zip-e60012)](https://github.com/sky-chaser-high/adobe-illustrator-scripts/releases/latest/download/Utility.zip)
+### toggleSelectSameTintPercentage.js
+「環境設定 > 一般 > 同じ濃度を選択」のオン/オフを切り替えます。
+
+
+
+#### 使用方法
+このスクリプトを実行するだけです。
+
+#### 動作条件
+Illustrator CC以降
+
+
+
+
+
+
+
+
+## 選択された文字の異体字を表示
+[![Download Utility.zip](https://img.shields.io/badge/Download-Utility.zip-e60012)](https://github.com/sky-chaser-high/adobe-illustrator-scripts/releases/latest/download/Utility.zip)
+### toggleShowCharacterAlternates.js
+「環境設定 > テキスト > 選択された文字の異体字を表示」のオン/オフを切り替えます。
+
+
+
+#### 使用方法
+このスクリプトを実行するだけです。
+
+#### 動作条件
+Illustrator 2020以降
+
+
+
+
+
+
+
+
+## 複数アンカーを選択時にハンドルを表示
[![Download Utility.zip](https://img.shields.io/badge/Download-Utility.zip-e60012)](https://github.com/sky-chaser-high/adobe-illustrator-scripts/releases/latest/download/Utility.zip)
### toggleShowHandles.js
-「環境設定 > 選択範囲・アンカー表示 > アンカーポイント、ハンドル、およびバウンディングボックスの表示 > 複数アンカーポイントを選択時にハンドルを表示」のオン/オフを切り替えます。
+「環境設定 > 選択範囲・アンカー表示 > アンカーポイント、ハンドル、およびバウンディングボックスの表示 > 複数アンカーを選択時にハンドルを表示」のオン/オフを切り替えます。
-![Toggle Show Handles](images/toggleShowHandles.png)
+
#### 使用方法
このスクリプトを実行するだけです。
@@ -2792,7 +2863,87 @@ Illustrator CC以降
#### 動作条件
Illustrator CC以降
-
+
+
+
+
+
+
+
+## パターンを変形
+[![Download Utility.zip](https://img.shields.io/badge/Download-Utility.zip-e60012)](https://github.com/sky-chaser-high/adobe-illustrator-scripts/releases/latest/download/Utility.zip)
+### toggleTransformPatternTiles.js
+「環境設定 > 一般 > パターンを変形」のオン/オフを切り替えます。
+
+
+
+#### 使用方法
+このスクリプトを実行するだけです。
+
+#### 動作条件
+Illustrator CC以降
+
+
+
+
+
+
+
+
+## プレビュー境界を使用
+[![Download Utility.zip](https://img.shields.io/badge/Download-Utility.zip-e60012)](https://github.com/sky-chaser-high/adobe-illustrator-scripts/releases/latest/download/Utility.zip)
+### toggleUsePreviewBounds.js
+「環境設定 > 一般 > プレビュー境界を使用」のオン/オフを切り替えます。
+
+
+
+#### 使用方法
+このスクリプトを実行するだけです。
+
+#### 動作条件
+Illustrator CC以降
+
+
+
+
+
+
+
+
+## 選択範囲へズーム
+[![Download Utility.zip](https://img.shields.io/badge/Download-Utility.zip-e60012)](https://github.com/sky-chaser-high/adobe-illustrator-scripts/releases/latest/download/Utility.zip)
+### toggleZoomToSelection.js
+「環境設定 > 選択範囲・アンカー表示 > 選択範囲 > 選択範囲へズーム」のオン/オフを切り替えます。
+
+
+
+#### 使用方法
+このスクリプトを実行するだけです。
+
+#### 動作条件
+Illustrator 2018以降
+
+
+
+
+
+
+
+
+## マウスホイールでズーム
+[![Download Utility.zip](https://img.shields.io/badge/Download-Utility.zip-e60012)](https://github.com/sky-chaser-high/adobe-illustrator-scripts/releases/latest/download/Utility.zip)
+### toggleZoomWithMouseWheel.js
+「環境設定 > 一般 > マウスホイールでズーム」のオン/オフを切り替えます。
+
+
+
+#### 使用方法
+このスクリプトを実行するだけです。
+
+#### 動作条件
+Illustrator 2022以降
+
+
diff --git a/images/copyLine.png b/images/copyLine.png
index 979550b..11687e5 100644
Binary files a/images/copyLine.png and b/images/copyLine.png differ
diff --git a/images/deleteAllRight.png b/images/deleteAllRight.png
index 67b020f..532b0ec 100644
Binary files a/images/deleteAllRight.png and b/images/deleteAllRight.png differ
diff --git a/images/deleteTrailingSpaces.png b/images/deleteTrailingSpaces.png
index c7d01a1..cc4e5b8 100644
Binary files a/images/deleteTrailingSpaces.png and b/images/deleteTrailingSpaces.png differ
diff --git a/images/deleteWord.png b/images/deleteWord.png
index 85e7415..c781557 100644
Binary files a/images/deleteWord.png and b/images/deleteWord.png differ
diff --git a/images/emptySelection.png b/images/emptySelection.png
index 01eeeaa..cc7586f 100644
Binary files a/images/emptySelection.png and b/images/emptySelection.png differ
diff --git a/images/encloseWordInParentheses.png b/images/encloseWordInParentheses.png
index 31a6a52..0e7a0f1 100644
Binary files a/images/encloseWordInParentheses.png and b/images/encloseWordInParentheses.png differ
diff --git a/images/goToLine.png b/images/goToLine.png
index 97380dd..95f7eb3 100644
Binary files a/images/goToLine.png and b/images/goToLine.png differ
diff --git a/images/goToText.png b/images/goToText.png
index 7e778f9..a9d2bd9 100644
Binary files a/images/goToText.png and b/images/goToText.png differ
diff --git a/images/insertLine.png b/images/insertLine.png
index c47f655..7a58e6c 100644
Binary files a/images/insertLine.png and b/images/insertLine.png differ
diff --git a/images/jumpForward.png b/images/jumpForward.png
index 8fcf6fd..2ee913f 100644
Binary files a/images/jumpForward.png and b/images/jumpForward.png differ
diff --git a/images/moveLine.png b/images/moveLine.png
index 3200293..d333a7a 100644
Binary files a/images/moveLine.png and b/images/moveLine.png differ
diff --git a/images/toggleAlignToGlyphBounds.png b/images/toggleAlignToGlyphBounds.png
index fb3cd12..9cd0227 100644
Binary files a/images/toggleAlignToGlyphBounds.png and b/images/toggleAlignToGlyphBounds.png differ
diff --git a/images/toggleFillNewTypeObjectsWithPlaceholderText.png b/images/toggleFillNewTypeObjectsWithPlaceholderText.png
new file mode 100644
index 0000000..9d385e4
Binary files /dev/null and b/images/toggleFillNewTypeObjectsWithPlaceholderText.png differ
diff --git a/images/togglePasteRemembersLayers.png b/images/togglePasteRemembersLayers.png
index 2d46b04..33ff991 100644
Binary files a/images/togglePasteRemembersLayers.png and b/images/togglePasteRemembersLayers.png differ
diff --git a/images/toggleSelectSameTintPercentage.png b/images/toggleSelectSameTintPercentage.png
new file mode 100644
index 0000000..995053d
Binary files /dev/null and b/images/toggleSelectSameTintPercentage.png differ
diff --git a/images/toggleShowCharacterAlternates.png b/images/toggleShowCharacterAlternates.png
new file mode 100644
index 0000000..ddf69d6
Binary files /dev/null and b/images/toggleShowCharacterAlternates.png differ
diff --git a/images/toggleShowHandles.png b/images/toggleShowHandles.png
index 1cd17bf..49a3225 100644
Binary files a/images/toggleShowHandles.png and b/images/toggleShowHandles.png differ
diff --git a/images/toggleTransformPatternTiles.png b/images/toggleTransformPatternTiles.png
new file mode 100644
index 0000000..ab56cd9
Binary files /dev/null and b/images/toggleTransformPatternTiles.png differ
diff --git a/images/toggleUsePreviewBounds.png b/images/toggleUsePreviewBounds.png
new file mode 100644
index 0000000..e1d1b07
Binary files /dev/null and b/images/toggleUsePreviewBounds.png differ
diff --git a/images/toggleZoomToSelection.png b/images/toggleZoomToSelection.png
new file mode 100644
index 0000000..15d5cc1
Binary files /dev/null and b/images/toggleZoomToSelection.png differ
diff --git a/images/toggleZoomWithMouseWheel.png b/images/toggleZoomWithMouseWheel.png
new file mode 100644
index 0000000..0b84f3e
Binary files /dev/null and b/images/toggleZoomWithMouseWheel.png differ
diff --git a/scripts/generateGradientColor.js b/scripts/generateGradientColor.js
index d157165..2fbba7b 100755
--- a/scripts/generateGradientColor.js
+++ b/scripts/generateGradientColor.js
@@ -18,7 +18,7 @@
Illustrator CS4 or higher
Version
- 1.0.2
+ 1.1.0
Homepage
github.com/sky-chaser-high/adobe-illustrator-scripts
@@ -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);
@@ -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;
}
}
@@ -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];
@@ -139,6 +153,10 @@ function localizeUI() {
title: {
en: 'Enter a gradient name.',
ja: 'グラデーション名を入力してください。'
+ },
+ name: {
+ en: 'Gradient',
+ ja: 'グラデーション'
}
};
}
@@ -146,7 +164,7 @@ function localizeUI() {
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;
}
diff --git a/scripts/splitText.js b/scripts/splitText.js
index fa66bd8..5b3b9d7 100755
--- a/scripts/splitText.js
+++ b/scripts/splitText.js
@@ -19,7 +19,7 @@
Illustrator CC or higher
Version
- 1.1.0
+ 1.2.0
Homepage
github.com/sky-chaser-high/adobe-illustrator-scripts
@@ -148,8 +148,8 @@ function splitWords() {
}
items = app.activeDocument.selection;
texts = getTextFrames(items);
- for (var j = 0; j < texts.length; j++) {
- removeLineHeadSpace(texts[j]);
+ for (var j = texts.length - 1; j >= 0; j--) {
+ removeLeadingSpace(texts[j]);
}
}
@@ -186,9 +186,14 @@ function splitText(item, flag) {
function split(text, contents, flag) {
- var base = {
- x: flag.line ? text.anchor[0] : text.position[0],
- y: flag.line ? text.anchor[1] : text.position[1]
+ var justification = getJustification(text);
+ if (text.lines.length == 1) {
+ changeToLeftAlignment(text, justification);
+ }
+
+ var position = {
+ x: text.anchor[0],
+ y: text.anchor[1]
};
var item = text.duplicate();
@@ -196,21 +201,23 @@ function split(text, contents, flag) {
var last = text.textRanges.length;
text = removeContents(text, end, last);
- text = move(text, base, flag.line);
+ text = move(text, position);
item = removeContents(item, 0, end);
if (hasLinefeed(item.contents)) {
item = moveNextLine(item);
}
else {
- var position = {
- x: base.x + text.width,
- y: base.y - text.height
- };
- item = move(item, position, flag.line);
+ position = getTrailingAnchorPosition(text);
+ item = move(item, position);
}
if (!item.contents) item.remove();
+ if (text.lines.length == 1) {
+ resetAlignment(text, justification);
+ resetAlignment(item, justification);
+ }
+
removeTrailingSpaces(text.textRange);
return item;
}
@@ -225,27 +232,24 @@ function removeContents(text, start, end) {
}
-function move(text, base, isLine) {
- var left = isLine ? text.anchor[0] : text.position[0];
- var top = isLine ? text.anchor[1] : text.position[1];
+function move(text, base) {
+ var left = text.anchor[0];
+ var top = text.anchor[1];
var x = base.x - left;
- var y = 0;
- if (text.orientation == TextOrientation.VERTICAL) {
- x = 0;
- y = base.y - top;
- }
+ var y = base.y - top;
text.translate(x, y);
return text;
}
function moveNextLine(text) {
+ var angle = getRotationAngle(text);
var leading = getLeading(text);
- var x = 0;
- var y = leading * -1;
+ var x = leading * Math.sin(angle);
+ var y = leading * Math.cos(angle) * -1;
if (text.orientation == TextOrientation.VERTICAL) {
- x = leading * -1;
- y = 0;
+ x = leading * Math.cos(angle) * -1;
+ y = leading * Math.sin(angle) * -1;
}
text.textRanges[0].remove();
text.translate(x, y);
@@ -253,6 +257,13 @@ function moveNextLine(text) {
}
+function getRotationAngle(item) {
+ var matrix = item.matrix;
+ var rad = Math.atan2(matrix.mValueB, matrix.mValueA);
+ return rad;
+}
+
+
// Error countermeasure.
// an Illustrator error occurred: 1346458189 ('PARM')
function getLeading(text) {
@@ -286,6 +297,84 @@ function getLanguage(text) {
}
+function getTrailingAnchorPosition(text) {
+ var justification = getJustification(text);
+ var top = text.top;
+ var left = text.left;
+
+ var shrink = 80;
+ var expand = (1 / shrink) * 10000;
+ text.resize(shrink, shrink);
+
+ switch (justification) {
+ case Justification.LEFT:
+ case Justification.CENTER:
+ setJustification(text, Justification.RIGHT);
+ break;
+ case Justification.RIGHT:
+ setJustification(text, Justification.LEFT);
+ break;
+ }
+ text.resize(expand, expand);
+ text.top = top;
+ text.left = left;
+
+ var x = text.anchor[0];
+ var y = text.anchor[1];
+
+ resetAlignment(text, justification);
+ return {
+ x: x,
+ y: y
+ };
+}
+
+
+function changeToLeftAlignment(text, justification) {
+ var top = text.top;
+ var left = text.left;
+ var shrink = 80;
+ var expand = (1 / shrink) * 10000;
+ text.resize(shrink, shrink);
+ switch (justification) {
+ case Justification.CENTER:
+ case Justification.RIGHT:
+ setJustification(text, Justification.LEFT);
+ break;
+ }
+ text.resize(expand, expand);
+ text.top = top;
+ text.left = left;
+}
+
+
+function changeToRightAlignment(text, justification) {
+ var top = text.top;
+ var left = text.left;
+ switch (justification) {
+ case Justification.LEFT:
+ case Justification.CENTER:
+ setJustification(text, Justification.RIGHT);
+ break;
+ }
+ text.top = top;
+ text.left = left;
+}
+
+
+function resetAlignment(text, justification) {
+ var top = text.top;
+ var left = text.left;
+ var shrink = 80;
+ var expand = (1 / shrink) * 10000;
+ text.resize(shrink, shrink);
+ setJustification(text, justification);
+ text.resize(expand, expand);
+ text.top = top;
+ text.left = left;
+}
+
+
function hasLinefeed(text) {
var linefeed = /^\r|^\u0003/;
return linefeed.test(text);
@@ -307,6 +396,18 @@ function getPeriodPosition(text) {
}
+function removeLeadingSpace(text) {
+ var justification = getJustification(text);
+ changeToRightAlignment(text, justification);
+
+ var str = text.textRanges[0];
+ var regex = /^\s/;
+ if (regex.test(str.contents)) str.remove();
+
+ resetAlignment(text, justification);
+}
+
+
function removeTrailingSpaces(text) {
var end = text.end - 1;
var regex = /\s+$/;
@@ -319,28 +420,6 @@ function removeNullCharacter(text) {
}
-function removeLineHeadSpace(text) {
- var CENTER = Justification.CENTER;
- var RIGHT = Justification.RIGHT;
- var justification = getJustification(text);
-
- var w1 = (justification == RIGHT) ? text.anchor[0] : text.width;
- var h1 = (justification == RIGHT) ? text.anchor[1] : text.height;
-
- var str = text.textRanges[0];
- var regex = /^\s/;
- if (regex.test(str.contents)) str.remove();
-
- var w2 = (justification == RIGHT) ? text.anchor[0] : text.width;
- var h2 = (justification == RIGHT) ? text.anchor[1] : text.height;
-
- var half = (justification == CENTER) ? 2 : 1;
- var x = (w1 - w2) / half;
- var y = (h2 - h1) / half;
- text.translate(x, y);
-}
-
-
function getTextFrames(items) {
var texts = [];
for (var i = 0; i < items.length; i++) {
@@ -358,8 +437,8 @@ function getTextFrames(items) {
function isValidVersion() {
var cc = 17;
- var aiVersion = parseInt(app.version);
- if (aiVersion < cc) return false;
+ var current = parseInt(app.version);
+ if (current < cc) return false;
return true;
}
diff --git a/scripts/splitTextAtCursorPosition.js b/scripts/splitTextAtCursorPosition.js
index 7f7cb39..0d62dbb 100755
--- a/scripts/splitTextAtCursorPosition.js
+++ b/scripts/splitTextAtCursorPosition.js
@@ -18,7 +18,7 @@
Illustrator CS6 or higher
Version
- 1.0.0
+ 1.1.0
Homepage
github.com/sky-chaser-high/adobe-illustrator-scripts
@@ -52,21 +52,30 @@ function main() {
function split(text, cursor) {
- var x = text.position[0];
- var y = text.position[1];
+ var justification = getJustification(text);
+ changeToLeftAlignment(text, justification);
+
+ var position = {
+ x: text.anchor[0],
+ y: text.anchor[1]
+ };
var start = 0;
var end = text.textRanges.length;
var item = text.duplicate();
text = removeContents(text, cursor, end);
- text = move(text, x, y);
+ text = move(text, position);
text.selected = true;
item = removeContents(item, start, cursor);
- item = move(item, x + text.width, y - text.height);
+ position = getTrailingAnchorPosition(text);
+ item = move(item, position);
item.selected = true;
+ resetAlignment(text, justification);
+ resetAlignment(item, justification);
+
return item;
}
@@ -80,16 +89,103 @@ function removeContents(text, start, end) {
}
-function move(text, x, y) {
- var left = text.position[0];
- var top = text.position[1];
- if (text.orientation == TextOrientation.HORIZONTAL) {
- text.translate(x - left, 0);
+function move(text, base) {
+ var left = text.anchor[0];
+ var top = text.anchor[1];
+ var x = base.x - left;
+ var y = base.y - top;
+ text.translate(x, y);
+ return text;
+}
+
+
+function getJustification(text) {
+ var ranges = text.textRanges;
+ for (var i = 0; i < ranges.length; i++) {
+ var range = ranges[i];
+ var paragraph = range.paragraphAttributes;
+ try {
+ return paragraph.justification;
+ }
+ catch (err) { }
}
- else {
- text.translate(0, y - top);
+}
+
+
+function setJustification(text, align) {
+ var ranges = text.textRanges;
+ for (var i = 0; i < ranges.length; i++) {
+ var range = ranges[i];
+ var paragraph = range.paragraphAttributes;
+ try {
+ paragraph.justification = align;
+ }
+ catch (err) { }
}
- return text;
+}
+
+
+function getTrailingAnchorPosition(text) {
+ var justification = getJustification(text);
+ var top = text.top;
+ var left = text.left;
+
+ var shrink = 80;
+ var expand = (1 / shrink) * 10000;
+ text.resize(shrink, shrink);
+
+ switch (justification) {
+ case Justification.LEFT:
+ case Justification.CENTER:
+ setJustification(text, Justification.RIGHT);
+ break;
+ case Justification.RIGHT:
+ setJustification(text, Justification.LEFT);
+ break;
+ }
+ text.resize(expand, expand);
+ text.top = top;
+ text.left = left;
+
+ var x = text.anchor[0];
+ var y = text.anchor[1];
+
+ resetAlignment(text, justification);
+ return {
+ x: x,
+ y: y
+ };
+}
+
+
+function changeToLeftAlignment(text, justification) {
+ var top = text.top;
+ var left = text.left;
+ var shrink = 80;
+ var expand = (1 / shrink) * 10000;
+ text.resize(shrink, shrink);
+ switch (justification) {
+ case Justification.CENTER:
+ case Justification.RIGHT:
+ setJustification(text, Justification.LEFT);
+ break;
+ }
+ text.resize(expand, expand);
+ text.top = top;
+ text.left = left;
+}
+
+
+function resetAlignment(text, justification) {
+ var top = text.top;
+ var left = text.left;
+ var shrink = 80;
+ var expand = (1 / shrink) * 10000;
+ text.resize(shrink, shrink);
+ setJustification(text, justification);
+ text.resize(expand, expand);
+ text.top = top;
+ text.left = left;
}
@@ -117,7 +213,7 @@ function getCursorPosition(text, start, end) {
function isValidVersion() {
var cs6 = 16;
- var aiVersion = parseInt(app.version);
- if (aiVersion < cs6) return false;
+ var current = parseInt(app.version);
+ if (current < cs6) return false;
return true;
}
diff --git a/scripts/toggleAlignToGlyphBounds.js b/scripts/toggleAlignToGlyphBounds.js
index 60f472e..c004576 100755
--- a/scripts/toggleAlignToGlyphBounds.js
+++ b/scripts/toggleAlignToGlyphBounds.js
@@ -15,7 +15,7 @@
Illustrator 2020 or higher
Version
- 1.0.0
+ 1.0.1
Homepage
github.com/sky-chaser-high/adobe-illustrator-scripts
@@ -26,23 +26,33 @@
=============================================================================================================================================== */
(function() {
- if (app.documents.length && isValidVersion()) main();
+ if (isValidVersion()) main();
})();
function main() {
+ var pointText = isAi2023Higher() ? 'EnableActualPointTextSpaceAlign' : 'EnableActualTextSpaceAlign';
+ var areaText = 'EnableActualAreaTextSpaceAlign';
var pref = app.preferences;
- var glyph = pref.getBooleanPreference('EnableActualTextSpaceAlign');
- pref.setBooleanPreference('EnableActualTextSpaceAlign', !glyph);
- pref.setBooleanPreference('EnableActualAreaTextSpaceAlign', !glyph);
- showDialog(glyph);
+ var glyph = pref.getBooleanPreference(pointText);
+ pref.setBooleanPreference(pointText, !glyph);
+ pref.setBooleanPreference(areaText, !glyph);
+ showDialog(!glyph);
+}
+
+
+function isAi2023Higher() {
+ var ai2023 = 27;
+ var current = parseFloat(app.version);
+ if (current < ai2023) return false;
+ return true;
}
function isValidVersion() {
- var cc2020 = 24.3;
- var aiVersion = parseFloat(app.version);
- if (aiVersion < cc2020) return false;
+ var ai2020 = 24.3;
+ var current = parseFloat(app.version);
+ if (current < ai2020) return false;
return true;
}
@@ -66,7 +76,7 @@ function showDialog(glyph) {
group1.margins = 20;
var statictext1 = group1.add('statictext', undefined, undefined, { name: 'statictext1' });
- statictext1.text = glyph ? ui.off : ui.on;
+ statictext1.text = glyph ? ui.on : ui.off;
var group2 = dialog.add('group', undefined, { name: 'group2' });
group2.orientation = 'row';
diff --git a/scripts/toggleFillNewTypeObjectsWithPlaceholderText.js b/scripts/toggleFillNewTypeObjectsWithPlaceholderText.js
new file mode 100755
index 0000000..d809e4f
--- /dev/null
+++ b/scripts/toggleFillNewTypeObjectsWithPlaceholderText.js
@@ -0,0 +1,114 @@
+/* ===============================================================================================================================================
+ toggleFillNewTypeObjectsWithPlaceholderText
+
+ Description
+ This script toggles the Preferences > Type > Fill New Type Objects With Placeholder Text.
+
+ Usage
+ Just run this script from File > Scripts > Other Script...
+
+ Notes
+ In rare cases, the script may not work if you continue to use it.
+ In this case, restart Illustrator and try again.
+
+ Requirements
+ Illustrator 2018 or higher
+
+ Version
+ 1.0.0
+
+ Homepage
+ github.com/sky-chaser-high/adobe-illustrator-scripts
+
+ License
+ Released under the MIT license.
+ https://opensource.org/licenses/mit-license.php
+ =============================================================================================================================================== */
+
+(function() {
+ if (isValidVersion()) main();
+})();
+
+
+function main() {
+ var key = 'text/fillWithDefaultText';
+ var jp = 'text/fillWithDefaultTextJP';
+ if (/ja/.test($.locale) && isAi2022Higher()) key = jp;
+ var pref = app.preferences;
+ var text = pref.getBooleanPreference(key);
+ pref.setBooleanPreference(key, !text);
+ showDialog(!text);
+}
+
+
+function isAi2022Higher() {
+ var ai2022 = 26;
+ var current = parseFloat(app.version);
+ if (current < ai2022) return false;
+ return true;
+}
+
+
+function isValidVersion() {
+ var cc2018 = 22;
+ var current = parseInt(app.version);
+ if (current < cc2018) return false;
+ return true;
+}
+
+
+function showDialog(text) {
+ $.localize = true;
+ var ui = localizeUI();
+
+ var dialog = new Window('dialog');
+ dialog.text = ui.title;
+ dialog.preferredSize.width = 320;
+ dialog.orientation = 'column';
+ dialog.alignChildren = ['fill', 'top'];
+ dialog.spacing = 10;
+ dialog.margins = 16;
+
+ var group1 = dialog.add('group', undefined, { name: 'group1' });
+ group1.orientation = 'row';
+ group1.alignChildren = ['center', 'center'];
+ group1.spacing = 10;
+ group1.margins = 20;
+
+ var statictext1 = group1.add('statictext', undefined, undefined, { name: 'statictext1' });
+ statictext1.text = text ? ui.on : ui.off;
+
+ var group2 = dialog.add('group', undefined, { name: 'group2' });
+ group2.orientation = 'row';
+ group2.alignChildren = ['center', 'center'];
+ group2.spacing = 10;
+ group2.margins = 0;
+
+ var button1 = group2.add('button', undefined, undefined, { name: 'button1' });
+ button1.text = ui.ok;
+ button1.preferredSize.width = 90;
+
+ dialog.show();
+}
+
+
+function localizeUI() {
+ return {
+ title: {
+ en: 'Fill New Type Objects With Placeholder Text',
+ ja: 'サンプルテキストを割り付け'
+ },
+ on: {
+ en: 'ON',
+ ja: 'ON'
+ },
+ off: {
+ en: 'OFF',
+ ja: 'OFF'
+ },
+ ok: {
+ en: 'OK',
+ ja: 'OK'
+ }
+ };
+}
diff --git a/scripts/togglePasteRemembersLayers.js b/scripts/togglePasteRemembersLayers.js
index 631956b..be32f76 100755
--- a/scripts/togglePasteRemembersLayers.js
+++ b/scripts/togglePasteRemembersLayers.js
@@ -15,7 +15,7 @@
Illustrator CC or higher
Version
- 1.0.0
+ 1.0.1
Homepage
github.com/sky-chaser-high/adobe-illustrator-scripts
@@ -26,23 +26,25 @@
=============================================================================================================================================== */
(function() {
- if (app.documents.length && isValidVersion()) main();
+ if (isValidVersion()) main();
})();
function main() {
+ var key = 'layers/pastePreserve';
+ var backup = 'layers/pastePreserveBackup';
var pref = app.preferences;
- var preserve = pref.getBooleanPreference('layers/pastePreserve');
- pref.setBooleanPreference('layers/pastePreserve', !preserve);
- pref.setBooleanPreference('layers/pastePreserveBackup', !preserve);
- showDialog(preserve);
+ var preserve = pref.getBooleanPreference(key);
+ pref.setBooleanPreference(key, !preserve);
+ pref.setBooleanPreference(backup, !preserve);
+ showDialog(!preserve);
}
function isValidVersion() {
var cc = 17;
- var aiVersion = parseFloat(app.version);
- if (aiVersion < cc) return false;
+ var current = parseInt(app.version);
+ if (current < cc) return false;
return true;
}
@@ -66,7 +68,7 @@ function showDialog(preserve) {
group1.margins = 20;
var statictext1 = group1.add('statictext', undefined, undefined, { name: 'statictext1' });
- statictext1.text = preserve ? ui.off : ui.on;
+ statictext1.text = preserve ? ui.on : ui.off;
var group2 = dialog.add('group', undefined, { name: 'group2' });
group2.orientation = 'row';
diff --git a/scripts/toggleSelectSameTintPercentage.js b/scripts/toggleSelectSameTintPercentage.js
new file mode 100755
index 0000000..acaa39a
--- /dev/null
+++ b/scripts/toggleSelectSameTintPercentage.js
@@ -0,0 +1,104 @@
+/* ===============================================================================================================================================
+ toggleSelectSameTintPercentage
+
+ Description
+ This script toggles the Preferences > General > Select Same Tint %.
+
+ Usage
+ Just run this script from File > Scripts > Other Script...
+
+ Notes
+ In rare cases, the script may not work if you continue to use it.
+ In this case, restart Illustrator and try again.
+
+ Requirements
+ Illustrator CC or higher
+
+ Version
+ 1.0.0
+
+ Homepage
+ github.com/sky-chaser-high/adobe-illustrator-scripts
+
+ License
+ Released under the MIT license.
+ https://opensource.org/licenses/mit-license.php
+ =============================================================================================================================================== */
+
+(function() {
+ if (isValidVersion()) main();
+})();
+
+
+function main() {
+ var key = 'selectSameTintPercentage';
+ var pref = app.preferences;
+ var tint = pref.getBooleanPreference(key);
+ pref.setBooleanPreference(key, !tint);
+ showDialog(!tint);
+}
+
+
+function isValidVersion() {
+ var cc = 17;
+ var current = parseInt(app.version);
+ if (current < cc) return false;
+ return true;
+}
+
+
+function showDialog(tint) {
+ $.localize = true;
+ var ui = localizeUI();
+
+ var dialog = new Window('dialog');
+ dialog.text = ui.title;
+ dialog.preferredSize.width = 260;
+ dialog.orientation = 'column';
+ dialog.alignChildren = ['fill', 'top'];
+ dialog.spacing = 10;
+ dialog.margins = 16;
+
+ var group1 = dialog.add('group', undefined, { name: 'group1' });
+ group1.orientation = 'row';
+ group1.alignChildren = ['center', 'center'];
+ group1.spacing = 10;
+ group1.margins = 20;
+
+ var statictext1 = group1.add('statictext', undefined, undefined, { name: 'statictext1' });
+ statictext1.text = tint ? ui.on : ui.off;
+
+ var group2 = dialog.add('group', undefined, { name: 'group2' });
+ group2.orientation = 'row';
+ group2.alignChildren = ['center', 'center'];
+ group2.spacing = 10;
+ group2.margins = 0;
+
+ var button1 = group2.add('button', undefined, undefined, { name: 'button1' });
+ button1.text = ui.ok;
+ button1.preferredSize.width = 90;
+
+ dialog.show();
+}
+
+
+function localizeUI() {
+ return {
+ title: {
+ en: 'Select Same Tint %',
+ ja: '同じ濃度を選択'
+ },
+ on: {
+ en: 'ON',
+ ja: 'ON'
+ },
+ off: {
+ en: 'OFF',
+ ja: 'OFF'
+ },
+ ok: {
+ en: 'OK',
+ ja: 'OK'
+ }
+ };
+}
diff --git a/scripts/toggleShowCharacterAlternates.js b/scripts/toggleShowCharacterAlternates.js
new file mode 100755
index 0000000..89d4b6a
--- /dev/null
+++ b/scripts/toggleShowCharacterAlternates.js
@@ -0,0 +1,104 @@
+/* ===============================================================================================================================================
+ toggleShowCharacterAlternates
+
+ Description
+ This script toggles the Preferences > Type > Show Character Alternates.
+
+ Usage
+ Just run this script from File > Scripts > Other Script...
+
+ Notes
+ In rare cases, the script may not work if you continue to use it.
+ In this case, restart Illustrator and try again.
+
+ Requirements
+ Illustrator 2020 or higher
+
+ Version
+ 1.0.0
+
+ Homepage
+ github.com/sky-chaser-high/adobe-illustrator-scripts
+
+ License
+ Released under the MIT license.
+ https://opensource.org/licenses/mit-license.php
+ =============================================================================================================================================== */
+
+(function() {
+ if (isValidVersion()) main();
+})();
+
+
+function main() {
+ var key = 'text/enableAlternateGlyph';
+ var pref = app.preferences;
+ var glyph = pref.getBooleanPreference(key);
+ pref.setBooleanPreference(key, !glyph);
+ showDialog(!glyph);
+}
+
+
+function isValidVersion() {
+ var ai2020 = 24;
+ var current = parseInt(app.version);
+ if (current < ai2020) return false;
+ return true;
+}
+
+
+function showDialog(glyph) {
+ $.localize = true;
+ var ui = localizeUI();
+
+ var dialog = new Window('dialog');
+ dialog.text = ui.title;
+ dialog.preferredSize.width = 260;
+ dialog.orientation = 'column';
+ dialog.alignChildren = ['fill', 'top'];
+ dialog.spacing = 10;
+ dialog.margins = 16;
+
+ var group1 = dialog.add('group', undefined, { name: 'group1' });
+ group1.orientation = 'row';
+ group1.alignChildren = ['center', 'center'];
+ group1.spacing = 10;
+ group1.margins = 20;
+
+ var statictext1 = group1.add('statictext', undefined, undefined, { name: 'statictext1' });
+ statictext1.text = glyph ? ui.on : ui.off;
+
+ var group2 = dialog.add('group', undefined, { name: 'group2' });
+ group2.orientation = 'row';
+ group2.alignChildren = ['center', 'center'];
+ group2.spacing = 10;
+ group2.margins = 0;
+
+ var button1 = group2.add('button', undefined, undefined, { name: 'button1' });
+ button1.text = ui.ok;
+ button1.preferredSize.width = 90;
+
+ dialog.show();
+}
+
+
+function localizeUI() {
+ return {
+ title: {
+ en: 'Show Character Alternates',
+ ja: '選択された文字の異体字を表示'
+ },
+ on: {
+ en: 'ON',
+ ja: 'ON'
+ },
+ off: {
+ en: 'OFF',
+ ja: 'OFF'
+ },
+ ok: {
+ en: 'OK',
+ ja: 'OK'
+ }
+ };
+}
diff --git a/scripts/toggleShowHandles.js b/scripts/toggleShowHandles.js
index 64a884e..4f9b891 100755
--- a/scripts/toggleShowHandles.js
+++ b/scripts/toggleShowHandles.js
@@ -2,7 +2,8 @@
toggleShowHandles
Description
- This script toggles the Preferences > Selection & Anchor Display > Anchor Points, Handle, and Bounding Box Display > Show handles when multiple anchors are selected.
+ This script toggles the Preferences > Selection & Anchor Display > Anchor Points, Handle, and Bounding Box Display >
+ Show handles when multiple anchors are selected.
Usage
Just run this script from File > Scripts > Other Script...
@@ -15,7 +16,7 @@
Illustrator CC or higher
Version
- 1.0.0
+ 1.0.1
Homepage
github.com/sky-chaser-high/adobe-illustrator-scripts
@@ -26,24 +27,25 @@
=============================================================================================================================================== */
(function() {
- if (app.documents.length && isValidVersion()) main();
+ if (isValidVersion()) main();
})();
function main() {
+ var key = 'showDirectionHandles';
var pref = app.preferences;
- var handle = pref.getBooleanPreference('showDirectionHandles');
- pref.setBooleanPreference('showDirectionHandles', !handle);
+ var handle = pref.getBooleanPreference(key);
+ pref.setBooleanPreference(key, !handle);
- var items = app.activeDocument.selection;
- if (!items.length) showDialog(handle);
+ var items = (app.documents.length) ? app.activeDocument.selection : [];
+ if (!items.length) showDialog(!handle);
}
function isValidVersion() {
var cc = 17;
- var aiVersion = parseFloat(app.version);
- if (aiVersion < cc) return false;
+ var current = parseInt(app.version);
+ if (current < cc) return false;
return true;
}
@@ -67,7 +69,7 @@ function showDialog(handle) {
group1.margins = 20;
var statictext1 = group1.add('statictext', undefined, undefined, { name: 'statictext1' });
- statictext1.text = handle ? ui.hide : ui.show;
+ statictext1.text = handle ? ui.on : ui.off;
var group2 = dialog.add('group', undefined, { name: 'group2' });
group2.orientation = 'row';
@@ -86,16 +88,16 @@ function showDialog(handle) {
function localizeUI() {
return {
title: {
- en: 'Show handles for multiple selected anchor points',
- ja: '選択した複数のアンカーポイントのハンドルを表示'
+ en: 'Show handles when multiple anchors are selected',
+ ja: '複数アンカーを選択時にハンドルを表示'
},
- show: {
- en: 'Show',
- ja: '表示'
+ on: {
+ en: 'ON',
+ ja: 'ON'
},
- hide: {
- en: 'Hide',
- ja: '非表示'
+ off: {
+ en: 'OFF',
+ ja: 'OFF'
},
ok: {
en: 'OK',
diff --git a/scripts/toggleTransformPatternTiles.js b/scripts/toggleTransformPatternTiles.js
new file mode 100755
index 0000000..1cf310c
--- /dev/null
+++ b/scripts/toggleTransformPatternTiles.js
@@ -0,0 +1,104 @@
+/* ===============================================================================================================================================
+ toggleTransformPatternTiles
+
+ Description
+ This script toggles the Preferences > General > Transform Pattern Tiles.
+
+ Usage
+ Just run this script from File > Scripts > Other Script...
+
+ Notes
+ In rare cases, the script may not work if you continue to use it.
+ In this case, restart Illustrator and try again.
+
+ Requirements
+ Illustrator CC or higher
+
+ Version
+ 1.0.0
+
+ Homepage
+ github.com/sky-chaser-high/adobe-illustrator-scripts
+
+ License
+ Released under the MIT license.
+ https://opensource.org/licenses/mit-license.php
+ =============================================================================================================================================== */
+
+(function() {
+ if (isValidVersion()) main();
+})();
+
+
+function main() {
+ var key = 'transformPatterns';
+ var pref = app.preferences;
+ var pattern = pref.getBooleanPreference(key);
+ pref.setBooleanPreference(key, !pattern);
+ showDialog(!pattern);
+}
+
+
+function isValidVersion() {
+ var cc = 17;
+ var current = parseInt(app.version);
+ if (current < cc) return false;
+ return true;
+}
+
+
+function showDialog(pattern) {
+ $.localize = true;
+ var ui = localizeUI();
+
+ var dialog = new Window('dialog');
+ dialog.text = ui.title;
+ dialog.preferredSize.width = 260;
+ dialog.orientation = 'column';
+ dialog.alignChildren = ['fill', 'top'];
+ dialog.spacing = 10;
+ dialog.margins = 16;
+
+ var group1 = dialog.add('group', undefined, { name: 'group1' });
+ group1.orientation = 'row';
+ group1.alignChildren = ['center', 'center'];
+ group1.spacing = 10;
+ group1.margins = 20;
+
+ var statictext1 = group1.add('statictext', undefined, undefined, { name: 'statictext1' });
+ statictext1.text = pattern ? ui.on : ui.off;
+
+ var group2 = dialog.add('group', undefined, { name: 'group2' });
+ group2.orientation = 'row';
+ group2.alignChildren = ['center', 'center'];
+ group2.spacing = 10;
+ group2.margins = 0;
+
+ var button1 = group2.add('button', undefined, undefined, { name: 'button1' });
+ button1.text = ui.ok;
+ button1.preferredSize.width = 90;
+
+ dialog.show();
+}
+
+
+function localizeUI() {
+ return {
+ title: {
+ en: 'Transform Pattern Tiles',
+ ja: 'パターンを変形'
+ },
+ on: {
+ en: 'ON',
+ ja: 'ON'
+ },
+ off: {
+ en: 'OFF',
+ ja: 'OFF'
+ },
+ ok: {
+ en: 'OK',
+ ja: 'OK'
+ }
+ };
+}
diff --git a/scripts/toggleUsePreviewBounds.js b/scripts/toggleUsePreviewBounds.js
new file mode 100755
index 0000000..e02b55e
--- /dev/null
+++ b/scripts/toggleUsePreviewBounds.js
@@ -0,0 +1,104 @@
+/* ===============================================================================================================================================
+ toggleUsePreviewBounds
+
+ Description
+ This script toggles the Align panel menu > Use Preview Bounds or the Preferences > General > Use Preview Bounds.
+
+ Usage
+ Just run this script from File > Scripts > Other Script...
+
+ Notes
+ In rare cases, the script may not work if you continue to use it.
+ In this case, restart Illustrator and try again.
+
+ Requirements
+ Illustrator CC or higher
+
+ Version
+ 1.0.0
+
+ Homepage
+ github.com/sky-chaser-high/adobe-illustrator-scripts
+
+ License
+ Released under the MIT license.
+ https://opensource.org/licenses/mit-license.php
+ =============================================================================================================================================== */
+
+(function() {
+ if (isValidVersion()) main();
+})();
+
+
+function main() {
+ var key = 'includeStrokeInBounds';
+ var pref = app.preferences;
+ var bounds = pref.getBooleanPreference(key);
+ pref.setBooleanPreference(key, !bounds);
+ showDialog(!bounds);
+}
+
+
+function isValidVersion() {
+ var cc = 17;
+ var current = parseInt(app.version);
+ if (current < cc) return false;
+ return true;
+}
+
+
+function showDialog(bounds) {
+ $.localize = true;
+ var ui = localizeUI();
+
+ var dialog = new Window('dialog');
+ dialog.text = ui.title;
+ dialog.preferredSize.width = 260;
+ dialog.orientation = 'column';
+ dialog.alignChildren = ['fill', 'top'];
+ dialog.spacing = 10;
+ dialog.margins = 16;
+
+ var group1 = dialog.add('group', undefined, { name: 'group1' });
+ group1.orientation = 'row';
+ group1.alignChildren = ['center', 'center'];
+ group1.spacing = 10;
+ group1.margins = 20;
+
+ var statictext1 = group1.add('statictext', undefined, undefined, { name: 'statictext1' });
+ statictext1.text = bounds ? ui.on : ui.off;
+
+ var group2 = dialog.add('group', undefined, { name: 'group2' });
+ group2.orientation = 'row';
+ group2.alignChildren = ['center', 'center'];
+ group2.spacing = 10;
+ group2.margins = 0;
+
+ var button1 = group2.add('button', undefined, undefined, { name: 'button1' });
+ button1.text = ui.ok;
+ button1.preferredSize.width = 90;
+
+ dialog.show();
+}
+
+
+function localizeUI() {
+ return {
+ title: {
+ en: 'Use Preview Bounds',
+ ja: 'プレビュー境界を使用'
+ },
+ on: {
+ en: 'ON',
+ ja: 'ON'
+ },
+ off: {
+ en: 'OFF',
+ ja: 'OFF'
+ },
+ ok: {
+ en: 'OK',
+ ja: 'OK'
+ }
+ };
+}
diff --git a/scripts/toggleZoomToSelection.js b/scripts/toggleZoomToSelection.js
new file mode 100755
index 0000000..09a7024
--- /dev/null
+++ b/scripts/toggleZoomToSelection.js
@@ -0,0 +1,104 @@
+/* ===============================================================================================================================================
+ toggleZoomToSelection
+
+ Description
+ This script toggles the Preferences > Selection & Anchor Display > Selection > Zoom to Selection.
+
+ Usage
+ Just run this script from File > Scripts > Other Script...
+
+ Notes
+ In rare cases, the script may not work if you continue to use it.
+ In this case, restart Illustrator and try again.
+
+ Requirements
+ Illustrator 2018 or higher
+
+ Version
+ 1.0.0
+
+ Homepage
+ github.com/sky-chaser-high/adobe-illustrator-scripts
+
+ License
+ Released under the MIT license.
+ https://opensource.org/licenses/mit-license.php
+ =============================================================================================================================================== */
+
+(function() {
+ if (isValidVersion()) main();
+})();
+
+
+function main() {
+ var key = 'zoomToSelection';
+ var pref = app.preferences;
+ var zoom = pref.getBooleanPreference(key);
+ pref.setBooleanPreference(key, !zoom);
+ showDialog(!zoom);
+}
+
+
+function isValidVersion() {
+ var cc2018 = 22;
+ var current = parseInt(app.version);
+ if (current < cc2018) return false;
+ return true;
+}
+
+
+function showDialog(zoom) {
+ $.localize = true;
+ var ui = localizeUI();
+
+ var dialog = new Window('dialog');
+ dialog.text = ui.title;
+ dialog.preferredSize.width = 260;
+ dialog.orientation = 'column';
+ dialog.alignChildren = ['fill', 'top'];
+ dialog.spacing = 10;
+ dialog.margins = 16;
+
+ var group1 = dialog.add('group', undefined, { name: 'group1' });
+ group1.orientation = 'row';
+ group1.alignChildren = ['center', 'center'];
+ group1.spacing = 10;
+ group1.margins = 20;
+
+ var statictext1 = group1.add('statictext', undefined, undefined, { name: 'statictext1' });
+ statictext1.text = zoom ? ui.on : ui.off;
+
+ var group2 = dialog.add('group', undefined, { name: 'group2' });
+ group2.orientation = 'row';
+ group2.alignChildren = ['center', 'center'];
+ group2.spacing = 10;
+ group2.margins = 0;
+
+ var button1 = group2.add('button', undefined, undefined, { name: 'button1' });
+ button1.text = ui.ok;
+ button1.preferredSize.width = 90;
+
+ dialog.show();
+}
+
+
+function localizeUI() {
+ return {
+ title: {
+ en: 'Zoom to Selection',
+ ja: '選択範囲へズーム'
+ },
+ on: {
+ en: 'ON',
+ ja: 'ON'
+ },
+ off: {
+ en: 'OFF',
+ ja: 'OFF'
+ },
+ ok: {
+ en: 'OK',
+ ja: 'OK'
+ }
+ };
+}
diff --git a/scripts/toggleZoomWithMouseWheel.js b/scripts/toggleZoomWithMouseWheel.js
new file mode 100755
index 0000000..4ed164f
--- /dev/null
+++ b/scripts/toggleZoomWithMouseWheel.js
@@ -0,0 +1,104 @@
+/* ===============================================================================================================================================
+ toggleZoomWithMouseWheel
+
+ Description
+ This script toggles the Preferences > General > Zoom with Mouse Wheel.
+
+ Usage
+ Just run this script from File > Scripts > Other Script...
+
+ Notes
+ In rare cases, the script may not work if you continue to use it.
+ In this case, restart Illustrator and try again.
+
+ Requirements
+ Illustrator 2022 or higher
+
+ Version
+ 1.0.0
+
+ Homepage
+ github.com/sky-chaser-high/adobe-illustrator-scripts
+
+ License
+ Released under the MIT license.
+ https://opensource.org/licenses/mit-license.php
+ =============================================================================================================================================== */
+
+(function() {
+ if (isValidVersion()) main();
+})();
+
+
+function main() {
+ var key = 'zoomWithMouseWheel';
+ var pref = app.preferences;
+ var zoom = pref.getBooleanPreference(key);
+ pref.setBooleanPreference(key, !zoom);
+ showDialog(!zoom);
+}
+
+
+function isValidVersion() {
+ var ai2022 = 26;
+ var current = parseInt(app.version);
+ if (current < ai2022) return false;
+ return true;
+}
+
+
+function showDialog(zoom) {
+ $.localize = true;
+ var ui = localizeUI();
+
+ var dialog = new Window('dialog');
+ dialog.text = ui.title;
+ dialog.preferredSize.width = 260;
+ dialog.orientation = 'column';
+ dialog.alignChildren = ['fill', 'top'];
+ dialog.spacing = 10;
+ dialog.margins = 16;
+
+ var group1 = dialog.add('group', undefined, { name: 'group1' });
+ group1.orientation = 'row';
+ group1.alignChildren = ['center', 'center'];
+ group1.spacing = 10;
+ group1.margins = 20;
+
+ var statictext1 = group1.add('statictext', undefined, undefined, { name: 'statictext1' });
+ statictext1.text = zoom ? ui.on : ui.off;
+
+ var group2 = dialog.add('group', undefined, { name: 'group2' });
+ group2.orientation = 'row';
+ group2.alignChildren = ['center', 'center'];
+ group2.spacing = 10;
+ group2.margins = 0;
+
+ var button1 = group2.add('button', undefined, undefined, { name: 'button1' });
+ button1.text = ui.ok;
+ button1.preferredSize.width = 90;
+
+ dialog.show();
+}
+
+
+function localizeUI() {
+ return {
+ title: {
+ en: 'Zoom with Mouse Wheel',
+ ja: 'マウスホイールでズーム'
+ },
+ on: {
+ en: 'ON',
+ ja: 'ON'
+ },
+ off: {
+ en: 'OFF',
+ ja: 'OFF'
+ },
+ ok: {
+ en: 'OK',
+ ja: 'OK'
+ }
+ };
+}