Joshua Faget
Forum Replies Created
-
I don’t know how to rename a file, the other part I will figure out on my own… there isn’t much in the documentation regarding opening files with ExtendScript and etc.
-
When I do the following, im getting a blank new file.
I’d like to be able to duplicate a .jpg file for example that way, so halfway through I can mess with the building blocks of the file.
var file = File.openDialog();
if (file && file.open("r")){
var content = file.read();
file.close();//do stuff to var content here
var save = File.saveDialog();
var newFile = new File(save);
newFile.open("w");
newFile.write(content);
newFile.close;};
-
This will change the Hue of the color only, not the saturation or brightness… you can adjust it manually from the AE color picker!
Speed=4;
Amount= 100; //a value between 0,100HSL = rgbToHsl(value);
H = linear(wiggle(Speed,Amount)[0]/100,-1,1,0,1);
S=HSL[1];
L=HSL[2];
hslToRgb([H,S,L,1])
-
I was selecting the proper thing, adding a .path fixed it!
var selectedShape = app.project.activeItem.selectedProperties[0].path.value.vertices;alert(selectedShape);
-
Joshua Faget
October 7, 2016 at 11:15 am in reply to: Absolute Layer Possition [toWorld() expression]Hello Dan,
Thank you very much for your reply.
Your solution works really well, but when the layer is a shape layer it doesn’t work unfortunately. For some bizarre reason anchor point coordinates for a solid layer and a shape layer are different, when they are in the same spot.
-
Hello,
When I run my script from “ExtendScript” with this:
var myButton= mainGroup.add(“iconbutton”, undefined, image=”./Scripts/(ImageAssets)/MyButton.png”);It works, but when I save my Script and place it in the Scripts folder AND in the ScriptUI Panels folder … it stops working.
If I change it to
var myButton= mainGroup.add(“iconbutton”, undefined, image=”./(ImageAssets)/MyButton.png”);
it doesn’t work neither when I run it from the Scripts folder nor when I run it from ScriptUI Panels folder…What I am trying to achieve is to avoid “C:/Program Files…etc”
-
Disregard my previous comment… I overly complicated it for no reason.
alert('Thanks Xavier') // :D -
Wow, thank you very much, this is really useful.
But unfortunately I am running into an issue. I got it to change the fill with a value in a predefined variable, BUT it seems to be breaking the recursion when I try to slip some more information in the functions.
var rgb = [0.5, 1, 1];ChangeColorButton.onClick = function() {
var Color = rgb;//TheSelectedLayer
var Selection = app.project.activeItem.selectedLayers[0];//RECURSION FUNCTION
function recurseShape(g, groupHandler, rgb) {
// g shape layer or group inside a shape ( should have a content property )
// groupHandler : what do do with each groupif (!g.content) return; // doesnt apply
groupHandler(g, rgb);
if (!g.content.property("ADBE Vector Group")) return;for (var n = 1; n <= g.content.numProperties; n++) {
if (g.content.property(n).matchName === "ADBE Vector Group") recurseShape(g.content.property(n), groupHandler);
};
};//WHAT TO DO
function myGroupHandler_changeFillToGFill(g, rgb) {
// g shape layer or group inside a shape ( should have a content property )
if (!g.content || !g.content.property("ADBE Vector Graphic - Fill")) return;for (var n = 1; n <= g.content.numProperties; n++) {
if (g.content.property(n).matchName === "ADBE Vector Graphic - Fill") {
g.content.property(n).property(4).setValue(rgb);
};
};
};//EXECUTION
app.beginUndoGroup("Change Fills to G-Fills");
recurseShape(Selection, myGroupHandler_changeFillToGFill, Color);
app.endUndoGroup();}
-
Thank you very much…
While my post was pending review, I’ve figured out a way to do it by resizing it to 0, but your solution is much more elegant.
I tried it before, but couldn’t figure out exactly how it works…Thanks a bunch.
alert('Thank You') // :D