Skip to content

Commit

Permalink
add togglePasteRemembersLayers.js
Browse files Browse the repository at this point in the history
  • Loading branch information
sky-chaser-high committed Dec 30, 2023
1 parent fbcf525 commit 42111a6
Show file tree
Hide file tree
Showing 4 changed files with 145 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ If you find a script that interests you, please download it from [![Download](ht
- [Sum Numbers](#sumNumbersjs)
- [Sync View](#syncViewjs)
- [Toggle Align to Glyph Bounds](#toggleAlignToGlyphBoundsjs)
- [Toggle Paste Remembers Layers](#togglePasteRemembersLayersjs) `New`
- [Toggle Show Handles](#toggleShowHandlesjs)
<br><br><br>

Expand Down Expand Up @@ -2171,6 +2172,25 @@ Illustrator 2020 or higher



# <a name="togglePasteRemembersLayersjs">togglePasteRemembersLayers.js</a>
[![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)
This script toggles the Layers panel menu > Paste Remembers Layers.

![Toggle Paste Remembers Layers](images/togglePasteRemembersLayers.png)

### Usage
Just run this script.

### Requirements
Illustrator CC or higher

<div align="right">[ <a href="#utility">↑ Back to Top ↑</a> ]</div>
<br>





# <a name="toggleShowHandlesjs">toggleShowHandles.js</a>
[![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)
This script toggles the Preferences > Selection & Anchor Display > Anchor Points, Handle, and Bounding Box Display > Show handles when multiple anchors are selected.
Expand Down
21 changes: 21 additions & 0 deletions README_ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ Adobe Illustratorのスクリプト集です。
- [**ウィンドウを並べて表示**](#ウィンドウを並べて表示) arrangeWindows.js
- [**拡大・縮小率を表示**](#拡大縮小率を表示) compareScale.js
- [**距離を測る**](#距離を測る) measureDistance.js
- [**コピー元のレイヤーにペーストを切り替える**](#コピー元のレイヤーにペーストを切り替える) togglePasteRemembersLayers.js `New`
- [**字形の境界に整列を切り替える**](#字形の境界に整列を切り替える) toggleAlignToGlyphBounds.js
- [**すべてのドキュメントを閉じる**](#すべてのドキュメントを閉じる) closeAllDocuments.js
- [**選択した複数のアンカーポイントのハンドルを表示/隠すを切り替える**](#選択した複数のアンカーポイントのハンドルを表示隠すを切り替える) toggleShowHandles.js
Expand Down Expand Up @@ -2297,6 +2298,26 @@ Illustrator 2020以降



## <a name="コピー元のレイヤーにペーストを切り替える">コピー元のレイヤーにペーストを切り替える</a>
[![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
「レイヤーパネル > コピー元のレイヤーにペースト」のオン/オフを切り替えます。

![Toggle Paste Remembers Layers](images/togglePasteRemembersLayers.png)

#### 使用方法
このスクリプトを実行するだけです。

#### 動作条件
Illustrator CC以降

<div align="right">[ <a href="#ユーティリティ">↑ トップへ戻る ↑</a> ]</div>
<br>





## <a name="選択した複数のアンカーポイントのハンドルを表示隠すを切り替える">選択した複数のアンカーポイントのハンドルを表示/隠すを切り替える</a>
[![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
Expand Down
Binary file added 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.
104 changes: 104 additions & 0 deletions scripts/togglePasteRemembersLayers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
/* ===============================================================================================================================================
togglePasteRemembersLayers
Description
This script toggles the Layers panel menu > Paste Remembers Layers.
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 (app.documents.length && isValidVersion()) main();
})();


function main() {
var pref = app.preferences;
var preserve = pref.getBooleanPreference('layers/pastePreserve');
pref.setBooleanPreference('layers/pastePreserve', !preserve);
pref.setBooleanPreference('layers/pastePreserveBackup', !preserve);
showDialog(preserve);
}


function isValidVersion() {
var cc = 17;
var aiVersion = parseFloat(app.version);
if (aiVersion < cc) return false;
return true;
}


function showDialog(preserve) {
$.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 = preserve ? ui.off : ui.on;

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: 'Paste Remembers Layers',
ja: 'コピー元のレイヤーにペースト'
},
on: {
en: 'ON',
ja: 'ON'
},
off: {
en: 'OFF',
ja: 'OFF'
},
ok: {
en: 'OK',
ja: 'OK'
}
};
}

0 comments on commit 42111a6

Please sign in to comment.