app.doScript(function(){
var myDocu=app.activeDocument;
var Sel=myDocu.selection;
if (Sel.length==0) exit();
var Sel0=Sel[0];
if (!Sel0.hasOwnProperty('store')) exit();
if (app.libraries.length==0) exit();
var LibraryList=app.libraries.everyItem().name;
var myDialog1=app.dialogs.add({name:"ライブラリに登録"});
with(myDialog1){
with(dialogColumns.add()){
with (dialogRows.add()){
staticTexts.add({staticLabel:"登録先:"});
var LibraryListDD=dropdowns.add({stringList:LibraryList, selectedIndex:0});
}
with (dialogRows.add()){
staticTexts.add({staticLabel:"名前:"});
var AssetNameTE=textEditboxes.add({minWidth:200});
}
}
}
if (!myDialog1.show()) exit();
var myLibrary=app.libraries[LibraryListDD.selectedIndex];
if (Sel0.parent.constructor.name=='Character'){
var date=new Date;
var myObjStyle=myDocu.objectStyles.add({name:AssetNameTE.editContents+"("+date.getTime()+")"});
myObjStyle.properties={
enableFill : false,
enableStroke : false,
enableStrokeAndCornerOptions : false,
enableParagraphStyle : false,
enableTextFrameGeneralOptions : false,
enableTextFrameBaselineOptions : false,
enableTextFrameAutoSizingOptions : false,
enableStoryOptions : false,
enableTextWrapAndOthers : false,
enableAnchoredObjectOptions : true,
enableFrameFittingOptions : false
}
var EffectsMUSHI={
enableBevelEmboss : false,
enableDirectionalFeather : false,
enableDropShadow : false,
enableFeather : false,
enableGradientFeather : false,
enableInnerGlow : false,
enableInnerShadow : false,
enableOuterGlow : false,
enableSatin : false,
enableTransparency : false
}
myObjStyle.contentEffectsEnablingSettings.properties=EffectsMUSHI;
myObjStyle.fillEffectsEnablingSettings.properties=EffectsMUSHI;
myObjStyle.objectEffectsEnablingSettings.properties=EffectsMUSHI;
myObjStyle.strokeEffectsEnablingSettings.properties=EffectsMUSHI;
myObjStyle.anchoredObjectSettings.properties=Sel0.anchoredObjectSettings.properties;
Sel0.applyObjectStyle(myObjStyle);
myLibrary.store(Sel0,{name:AssetNameTE.editContents});
} else {
myLibrary.store(Sel,{name:AssetNameTE.editContents});
}
},ScriptLanguage.JAVASCRIPT,[],UndoModes.FAST_ENTIRE_SCRIPT);
プロフィール
最近の記事