You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Adobe After Effects插件的Extendscript中去除IconButton默认边框?

Fixing the Default Gray Border on After Effects ExtendScript IconButton

Hey there! I’ve fought this exact stubborn gray border issue with AE’s ExtendScript IconButton before—totally get how frustrating it is when the obvious outline property doesn’t work. Let’s get this sorted for you.

The Problem with Your Current Code

The outline = 0 property doesn’t target the default gray border on IconButton in AE’s ExtendScript environment. That property is meant for a different type of outline, not the component’s built-in border.

Working Solutions

Here are two reliable fixes that should remove the border completely:

1. Use borderStyle and Disable Focus Rings

This is the simplest and most effective fix for most cases. Add these lines to your code:

var myButtonImage = new File("image.png"); // Fixed the extra brackets in your original code
var myButton = window.add("iconbutton", undefined, myButtonImage);
myButton.size = [30, 30];

// Critical lines to remove borders
myButton.borderStyle = "none"; // Turns off the default gray border
myButton.drawFocusRing = false; // Prevents a focus outline from appearing when the button is clicked
myButton.outline = 0; // Keep your original line as a fallback
  • borderStyle = "none" directly overrides the component’s default border styling.
  • drawFocusRing = false ensures you don’t get an extra outline when the button is focused (a common gotcha).

2. Custom Graphic Override (For Edge Cases)

If the first method doesn’t work (rare, but possible in older AE versions), you can take full control by manually drawing the button’s state:

var myButtonImage = new File("image.png");
var myButton = window.add("iconbutton", undefined, myButtonImage);
myButton.size = [30, 30];

// Disable default rendering
myButton.autoDraw = false;

// Draw only the icon, no border
myButton.onDraw = function() {
  this.graphics.drawImage(myButtonImage, 0, 0, this.size[0], this.size[1]);
};

This bypasses the default button rendering entirely and just draws your icon directly.

Quick Note

Make sure your image.png has a transparent background—if it has a solid background, that might look like a border even after removing the component’s default one!

内容的提问来源于stack exchange,提问作者Phil

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.11 08:25:16