Applescript That changes properties of an already existing effect?

Talk about Pixelmator Pro, share tips & tricks, tutorials, and other resources.
User avatar

2021-03-30 19:39:46

I have an effect manually set to, say, 63,3 pixels.

This is the non-working way i'm trying to change its value through a script:
tell the eighth layer of the front document to set the properties of the second effect to {scale:10}
I've tried a bunch of other options, but here i am.

If anyone knows how to change that, please let me know.
Thank you.
User avatar

2021-03-31 14:38:55

Hey there! It would be interesting to take a look at the complete script, if possible. I believe you'd have to specify the name of the effect you're attempting to change.
User avatar

2021-04-01 08:40:09

Hello, Aurelija ! Thank you for your answer

here's code that's a bit different, but uses the same command "tell the n-th effect" to change its position and works well without specifying the name
tell application "Pixelmator Pro"
	set i to 15
	set j to 50
	repeat while i > 0
		
		tell the eighth layer of the front document to tell the fourth effect to set the position to {550 - j / 9, 2950 - j}
		
		set j to j + 150
		set i to i - 1
		
	end repeat
end tell

	
Haven't saved the code for changing the value of an effect, since I haven't figured out how to do it, but it'd be pretty much the same, apart from the function applied to an effect, as the one above I believe.

P.S. not adding to the topic of the message, but I've tried recently the latest version of P.Pro (myself use usually 1.83) and, subjectively ofc, the effects menu is much more clear in the earlier versions. Really wanna update my version, but much prefer the intuitiveness and "cleanness", are you guys gonna follow the taken in the latest versions approach, or that's "beta" of sorts? Hope I didn't make myself seem harsh, I really love your software, thank you!
User avatar

2021-04-01 12:11:26

Thanks for the script! After some digging around with the team, we've determined a couple of potential causes for the script not working.
First, you may be using some effects that are not yet scriptable in Pixelmator Pro. So, even though these effects and their properties show up in the app, their settings can't really be modified using AppleScript.
If the effect you're using is already in the Pixelmator Pro scripting dictionary but you still can't change its settings, this suggests some conflict within AppleScript. We've found that there are a couple of effect properties that can currently cause issues in AppleScript. The scale property is actually one of them. We're already looking into how we can sort this out.

As for the Effects tool, is there anything, in particular, you're missing from the pre-2.0 versions of Pixelmator Pro? It's unlikely we'll be getting back to the previous look, but we'd love to hear your feedback, and keep it in mind for the next time we work on the Effects tool improvements!
User avatar

2021-04-01 14:33:12

I tried that with Pixalate effect, if that matters and i was trying to adjust how strong its effect is. Maybe scale even isn't the right parameter to work with.

*

Regarding the Effects Preview window, it was nice when the previews were listed vertically in one column, left to the tab with a list of applied effects shown with their names and parameters. (also the effect properties window seemed more clear, maybe that's a matter of habit)

In general it seems effective, personally speaking, that my attention when working with the software is kept as much on general level of the whole window and its main blocks (EffectsPreview ver.pre-2.0 being as one long vertical tab, full height), rather than getting all the attention drawn into a small secondary block (EffectsPreview ver.post-2.0 being a small window).

What i love about your approach to design is that in general when i make smth i know that there is me doing something; whereas in photoshop or other software i often find myself not remembering myself in a way. And it seems like pre-2.0 UI-UX had a bit more elements that contributed to that.



But that might be a subject for a general discussion about design and gestalt psychology when one knows nothing better to do with his time

Thanks to your team and you, Aurelija, for your answer!
If possible, please let me know if the script thing gets cleared someday, it's amazing how it allows to make responsive digital posters

Good day!
User avatar

2021-04-02 08:11:08

Ah, got it. In that case, it's the latter situation. You can typically customize the Pixelate effect using the scale parameter when first adding it, using the regular command:
make new pixelate effect at the beginning of effects with properties {scale:10}
But for some reason we haven't pinpointed yet, this doesn't seem to work when changing this parameter in an already added effect. We'll let you know if we work something out here.

Also, thanks for taking the time to share your feedback on the layout of the Effects tool! This may not have affected everyone's workflows, but there was one very specific reason we decided to redesign Pixelmator Pro 2.0 without the Effects presets bar (or the presets bars of other tools). Showing or hiding the presets bar with Auto-center turned on was causing the entire image to move back and forth. The same thing happened when switching between tools that do have presets and those that don't. You may notice this if you're still using Pixelmator Pro 1.8. A separate section for presets integrated within the Tool Options bar seemed to us like a logical and viable solution. But I get that both approaches are quite different and one might serve some particular workflows better than the other.