ariffjeff
Explorer
ariffjeff
Explorer
Activity
‎May 06, 2021
09:33 AM
Here you go: https://drive.google.com/file/d/1BfFHTphuCB6_E5BsfdZOEIT9ON3ZXlU_/view?usp=sharing I would directly attach the .ai file here but I keep getting an error doing so.
... View more
‎May 05, 2021
08:27 AM
I've found out that text with a warp effect applied (such as an arc effect to make the text bend) will not resize along with other types of objects when you use something like: selected[0].resize(150, 150, true, true, true, true, 150, undefined) This occurs when the text is set to "edit contents" mode instead of "edit envelope" mode. You can see these two buttons in the top left of the UI when the warped text object is selected. Clicking on "edit envelope" to switch the edit mode and then doing the resize line again shows that the warped text resizes this time. Is there a workaround to get warped text to resize correctly when its mode is set to "edit contents"?
... View more
‎Apr 15, 2021
07:05 PM
2 Upvotes
Ah I don't know why I didn't think of that, thanks! Before this I actually went the not so smart route and just regex'd out the include lines thinking that would magically solve the problem. Of course it failed but at least I understand regex now lol.
... View more
‎Apr 15, 2021
02:07 PM
1 Upvote
I've been building a main Illustrator ScriptUI palette script that has some custom icon buttons on it that I can click to call other scripts. The scripts get called using BridgeTalk. Some of these scripts contain #include statements such as: #include "jsx_modules.jsx" ...that contain frequently used functions so that I can easily call them from multiple scripts. This makes it so that I don't have to copy the same functions to multiple files which would be very hard to mantain. This line of code as far as I can tell simply looks for other script files in the same directory as itself and just grabs their contents. This works quite well. But it causes a problem when I try to call scripts that have these #include lines by using BridgeTalk. My understanding is that using BridgeTalk to call scripts somehow executes the called scripts in a different directory entirely. I managed to find what I believe is that directory: C:\Users\USER\AppData\Local\Temp\esdebug This means that since they are being executed in this other secluded directory, the #include line will cause a failure since it can't find the other function module scripts in this directory. How do I go about solving this problem? Thanks. If anyone needs I'll share the BridgeTalk code I'm using.
... View more
‎Apr 13, 2021
12:51 PM
For reference, here is the bug report: https://illustrator.uservoice.com/forums/601447-illustrator-desktop-bugs/suggestions/43154166-eyedropper-creates-buggy-hidden-invisible-non-exis
... View more
‎Apr 13, 2021
07:15 AM
Here's a google drive link to an .ai file since attaching it directly just gave me an error saying the contents of the file don't match .ai even though it's just two text objects. Inside are two different text objects. One is just some normal default text. The other is text that I have selected and clicked on with the eye dropper tool to give it the strange invisible/pseudo-appearance.
... View more
‎Apr 13, 2021
06:09 AM
I get this behavior 25.2.1 on Windows. I forgot macOS existed ha.
... View more
‎Apr 12, 2021
12:56 PM
I will also call these schrodinger's appearances.
... View more
‎Apr 12, 2021
12:55 PM
Sometimes I find that newly created live text objects or other objects have appearances on them that I can't see in the Appearance tab but I know that some form of extra appearance exists (unless it's a bug) because going to the top menu and trying to do Object > Expand... won't work. This is because the option is greyed out and instead Object > Expand Appearance is available. When I click this I can see nothing changes in the Appearance tab, and yet Object > Expand... becomes available again. The existence of these hidden appearances actually causes problems with scripts I write in regards to dealing with appearances in various ways. Repoducing this problem is very easy as all you need to do is create some default text with no appearance, then with the text selected use the eyedropper tool to click on the text. You will notice in the Layers panel that the object's selection circle(if that's what it is called?) becomes filled with grey indicating it has an appearance even though the Appearance panel shows nothing has changed. This appearance has materialized out of nowhere. This has to be a bug right?
... View more
‎Apr 08, 2021
08:15 AM
1 Upvote
This worked thank you. I don't know why I didn't think to do this. Setting to null gave an error but setting to {} worked. myImg.image = {} Ironically setting it to an empty object caused my Image.prototype.onDraw() method to crash internally without giving an error which therefore made the image disappear from the dialog. I just handled that by adding in a if check and a return statement just to be safe and everything works perfectly. Thanks for the help!
... View more
‎Apr 08, 2021
07:24 AM
Is it possible in ExtendScript to set a ScriptUI image object to nothing such that the image that is rendered in the dialog window will disappear? I already know how to set the image to different images but not how to "delete" it if I don't want an image to appear at all. I already looked around in the documentation but I couldn't see anything relevant. Here's something similar to what I'm trying to go for. var w = new Window("dialog")
var myImg = w.add("image", undefined, File("path/to/initialImg.jpg"));
// some callback function here {
myImg.image = "" // trying to set to nothing but get error: not a file
// }
w.show() My current workaround is to set the image to a placeholder image that's just a black square. Better than not being able to change the image at all I suppose.
... View more
‎Apr 07, 2021
12:12 PM
1 Upvote
Just fixed my endless looping issue. I had written my set up in a really unorthodox way when I didn't need to where I was preemtively rendering a placeholder image and then trying to immediately replace it with a needed image. That's not the full story as I don't fully understand why the looping happened but essentially I had made it unecessarily complicated and somehow that was creating an infinite loop of redrawing the image by trying to change it, even though I wasn't explicitly calling anything multiple times. For future reference, if anyone needs to change the image after it has been added then just do something like this: var w = new Window("dialog", undefined, undefined, {closeButton: false});
// add the intial image object into the dialog
var myImage = w.add("image", undefined, File("path/to/image1.jpg"));
// change image to something else
myImage.image = "path/to/image2.jpg"
w.show() The line that changes the image to some other image would be in a callback function or something so that it can execute after w.show() while the dialog is on screen, therefore actually being useful instead of needlessly changing an image that hasn't even been rendered yet in this example code snippet.
... View more
‎Apr 01, 2021
03:07 PM
Thanks for trying lol! You may actually be correct in some sense regarding a different part of my code, so I'll take a look at it again with this in mind.
... View more
‎Apr 01, 2021
03:06 PM
Weird, I actually based my code off of this snippet myself. I must be doing something simple that's wrong. I'll only be able to take another look again at my work on Monday though.
... View more
‎Apr 01, 2021
02:03 PM
I have created a ScriptUI dialog that displays an image who's size can be manipulated by changing some settings of the native Image class like so just before the image is rendered: Image.prototype.onDraw() = function() {
...
this.graphics.drawImage(this.image, xy[0], xy[1], imageSize[0], imageSize[1])
} This works perfectly, my image looks great and fits exactly how I want it to inside the dialog box. But for some reason the onDraw() method keeps getting called repeatedly and I don't know how to stop it. Whenever an image is about to be rendered I expect this method to only be called once. I can't understand why this method would keep getting executed if I have only tried to display a single image once. This infinite loop of method calling causes the performance of the dialog box to be reduced/becomes laggy as the image keeps getting redrawn 50 or so times every second. The lag isn't terrible though as the dialog window is still usable and can serve it's purpose. I just want to get rid of this infinite loop since it's causing the lag and making adding other features difficult. Any ideas how to make it so that onDraw() only happends once? Or is there another solution? Thanks!
... View more
‎Mar 24, 2021
01:23 PM
3 Upvotes
Is there an alternative to redraw() that does the same thing but doesn't add to the number of undos. This command is great but if (just for arguement's sake) you have to run it in a for loop 10 times, then the user will have to undo 10 times to back to the state before script execution. Completely insane. There are cases where I need to use something like redraw() to force a script to update and realize that there are a different number of objects in the selection object than it currently incorrectly thinks. In fact I already found a ridiculous solution where I just set a position of something to itself and for whatever reason this makes selection update to the correct list of objects, all without adding to the undo amount: selection[0].position = [selection[0].position[0], selection[0].position[1]] Surely there must be a better way?
... View more
‎Mar 16, 2021
08:43 AM
And again another edit because I'm too quick for myself: aliases still don't seem to work.
... View more
‎Mar 16, 2021
08:40 AM
In terms of using alias files I actually just got those working because I forgot to remove the appended " - Shortcut" string that gets auto added on to the filename when you create an alias. But it still feels wrong using aliases. I'd like to point Illustrator to a whole new folder.
... View more
‎Mar 16, 2021
08:37 AM
Is it possible to tell Illustrator to look for .jsx scripts in a place other than the default of "C:\Program Files\Adobe\Adobe Illustrator 2021\Presets\en_US\Scripts"? (I also tried using .jsx aliases but Illustrator doesn't recognize those). Since I'm using git to control this folder full of scripts and other personal config files I feel it would be more appropriate if the folder was located in another place so that I could fill it up with any project files I want. Of course I could just do that with the default scripts folder anyways but it just feels wrong.
... View more
‎Mar 11, 2021
09:50 AM
1 Upvote
Is it possible to create a hidden folder in a Windows directory with ExtendScript? I already know how to create folders with Extendscript but not how to make them hidden as well. I tried creating folders with a dot in the name (/.someFolder) since that's usually how Windows hides folders but that didn't work.
... View more
‎Feb 22, 2021
02:02 PM
Thanks! It seems to be working. I got my image to be the correct size and position. Although my issue now is that the container it's in is still ginormous and is pushing all other dialog elements off the screen. I tried setting it to no avail but I didn't have much time to test it. I'll have to try again tomorrow. Thanks again!
... View more
‎Feb 22, 2021
10:24 AM
I have a scriptUI dialog that pops up and shows a list of file paths of images that exist in a directory. My goal is to make it so that a user can click on an item in the list which would trigger an event to set an existing ScriptUIImage object (that is already displaying an image) to show the selected image within the same dialog. In fact, I already figured this out and got it working with a single line of code, but thanks to a limitation, the size of the image cannot be set because the size property of a ScriptUIImage object is read-only for whatever reason. This means that each image displayed usually takes up the entire screen because they never get automatically resized to fit nicely inside the ScripUI dialog box. So I did some more digging and found some other methods that in theory should allow me to set the size of an image in ScriptUI, although I could be wrong. I already have everything working execept where I actually set the ScriptUIImage object to an image. I'm pretty sure I'm having a syntax issue or similar based on the error I get when I run the script, but the error message is too ambiguous to figure out what the real error actually is. For reference, I've been following this documentation: https://www.adobe.com/content/dam/acom/en/devnet/scripting/estk/javascript_tools_guide.pdf If you do CTRL+F search then you can follow along somewhat with the following: I've been trying to use "ScriptUIImage object", "newImage()", and "drawImage()". Below is what I have so far, but it leads to this error: Error 32: Cannot execute. No matter what arguments I provide for drawImage(...) I get that error. The documentation doesn't help with this very much. I provided a condensed version of the dialog so you can just copy paste it if you need to and it should just work. All the problems I'm having are under "// GRP_PROOFPREVIEW", where the actual logic begins where I set the image file path. var proofVer = new Window("dialog", undefined, undefined, {closeButton: false});
proofVer.text = "Choose Proof Version";
proofVer.orientation = "column";
proofVer.alignChildren = ["center","center"];
proofVer.spacing = 25;
proofVer.margins = [30,20,30,20];
var label = proofVer.add("statictext", undefined, undefined, {name: "label"});
label.text = "Choose a new PDF/JPG version to save this new proof as, or overwrite an old version...";
label.alignment = ["center","center"];
// USEROPTIONS
// ===========
var userOptions = proofVer.add("group", undefined, {name: "userOptions"});
userOptions.orientation = "row";
userOptions.alignChildren = ["center","top"];
userOptions.spacing = 15;
userOptions.margins = 0;
// GRP_PROOFPREVIEW
// ================
var grp_proofPreview = userOptions.add("group", undefined, {name: "grp_proofPreview"});
grp_proofPreview.preferredSize.width = 200;
grp_proofPreview.preferredSize.height = 200;
grp_proofPreview.orientation = "row";
grp_proofPreview.alignChildren = ["left","center"];
grp_proofPreview.spacing = 10;
grp_proofPreview.margins = 0;
grp_proofPreview.alignment = ["center","center"];
var img = "C:/path/to/image/image.jpg"
var scriptUIImageObject = ScriptUI.newImage(img, img, img, img)
var proofPreview = grp_proofPreview.add("image", undefined, scriptUIImageObject, {name: "proofPreview"});
proofPreview.graphics.drawImage(scriptUIImageObject, 0, 0)
proofVer.show();
... View more
‎Feb 16, 2021
06:28 AM
You've described what I experience frequently. Selecting in Illustrator has different outcomes based on whether you click the actual layer or the art in the viewport. Then trying to set the selection in extendscript straight up causes an error when locked/hidden items/subitems are present. So we get at least 3 different results based off trying to do one thing. Extremely inconsistent and just adds more edge cases. Thank you Adobe. Other than that I don't have other problems - nothing that I've found yet. The way to get around the error of selecting groups with hidden/locked sub items in ExtendScript is to record which ones are hidden/locked, then unhide/unlock them, the select the group, then rehide/relock them.
... View more
‎Feb 15, 2021
11:20 AM
1 Upvote
While it looks like I ultimately did not do the best job of accurately explaining my issue in such a way for you to properly understand it, you still were able to help me by getting me to think in another way to find solution to my problem! Thank you so much for your writeup. I'll be unsetting and resetting locked/hidden items with UUIDs so that I can therefore set a desired selection during those two actions.
... View more
‎Feb 15, 2021
09:13 AM
As an addon reason for why I need to set selections: In some cases I need to run commands in a script that change the type of an object, such as expanding a live text frame to become a path. This invalidates the textFrame object/variable that I am referencing because the data has completely changed and Illustrator/extendscript isn't smart enough to replace the old data with the new. In cases like this I might want to set a selection to the new data but I can't because the original object, and therefore, the new object was locked. I hope that make sense. It is a bit convoluted but it does make sense in specific scripting circumstances.
... View more
‎Feb 15, 2021
09:06 AM
I ran "selection = selection" as a test example to show that extendscript's behavior is incorrect. It doesn't make any conceivable sense that setting a variable to itself should return an error. Regardless of that... my issue is that I want to actually set the selection to any desired group because in my case I am duplicating selections which is causing the original selection and its duplicate to become selected at the same time, so I therefore go to set the selection to either group and I just receive the error due to locked/hidden sub items. Simply referencing "app.activeDocument.selection[0]" in my particular case is not actually what I need.
... View more
‎Feb 15, 2021
08:37 AM
1 Upvote
Using Extendscript, how do I set the selection to be a group which contains multiple objects like paths/images/whatever where only some of them are locked/hidden? If you select such a group in Illustrator manually, there is no problem - you can see that the group is selected just fine. But, for example, if you were to select such a group in Illustrator, then run an Extendscript with only this line: selection = selection You will encounter this error: error 9063: trying to select locked or hidden art This is obviously completely ridiculous because it is stating that you cannot select something even though it has already been selected beforehand. This error is frustrating as it makes trying to set the selection of groups nearly impossible most of the time, thus disrupting my ability to write useful scripts. Is there a way around this problem? Thanks!
... View more
‎Jan 12, 2021
11:45 AM
1 Upvote
Good thinking. I'll stick with the red squigglies. I'm so glad you seem to know so much about literally every problem I have apparently and that you're always able to help me. Infinite thanks!
... View more
‎Jan 12, 2021
10:31 AM
Update - Better way of calling other scripts: https://community.adobe.com/t5/illustrator/call-other-scripts-with-extendscript/m-p/11746728?page=1#M259191
... View more
‎Jan 12, 2021
10:25 AM
Thanks! It seems to work properly. Although the syntax to me is a little off-putting, especially since having to enter a function like this just seems really weird: eval("#include 'Path/ToMy/Script/Script.jsx' someFunc()"); The other reply by @Charu Rajput seems to also work with no functional difference that I've noticed and has more standard syntax. So I think that is the best solution here unless there is anything else magical that eval() does.
... View more