Home Creators Posts Import Register Favorites Logout

Downloads

Content

This time, I discovered Photoshop’s Linked Smart Objects feature. I can create a character.psd as a template, just like a class in object-or

This time, I discovered Photoshop’s Linked Smart Objects feature. I can create a character.psd as a template, just like a class in object-oriented programming. Then I can drop multiple instances into the project, and any changes made to the template will automatically update all linked copies.

Then it hit me—Hey, could I write a script to batch-export these?I asked an AI, and sure enough, it’s possible. So I decided to have the AI (Grok) write me a Python GUI to customize batch export rules.

However, Grok gave me a GUI that exports JSON rules, and then I’d need to write a JSX (JavaScript) script for Photoshop to execute.But the communication overhead was too high—I struggled until 2 AM without getting it to work.

So the next day, I decided to have Grok teach me JavaScript instead.

I’d never used JavaScript before, but I’ve written PHP.Honestly, even though JavaScript has "Java" in its name, it’s much more like PHP—no strict type declarations for functions or variables.So the syntax wasn’t really an issue; I just needed to learn object and function usage.Luckily, Grok was great at explaining which Photoshop DOM (Document Object Model) functions were available and how to use them.

If I hadn’t written this script, I’d have had to manually export 92+ images—tedious and exhausting, if not outright soul-crushing.

這次發現PS的連結智慧圖層,我可以先創建一個角色.psd當作始本,就像物件導向的類別一樣,我可以丟多部物件進入專案,只要修改始本所有實例(副本)都會跟著改變。

同樣,想到,诶?我是不是可以寫一個腳本讓PS批量輸出?

問問AI,還真有,所以打算讓AI用python寫一個GUI讓我客製化批量輸出規則。

然而Grok給我一個GUI專門輸出JSON規則,再寫一個jsx( JavaScript)讓PS跑。

可是這溝通成本太高了,搞到半夜兩點都弄不出個東西。

所以隔天我打算讓Grok教我寫JavaScript。

我沒碰過JavaScript,但寫過PHP。

老實說,雖然JavaScript名字裡頭有Java,但他更像PHP,函式、變數都不用寫死型別。

所以語法基本上沒什麼障礙,只是得認得物件和函式用法。

因此,Grok這時都能夠很好的告訴我關於PS的,哪些函式能用那些物件的介面使用。

如果沒寫腳本,這次圖片92張以上,我慢慢自己點點圖圖輸輸出出沒累死也快煩死吧。

Completed attachment concludes X-ray and dressing without pants.

完整附件包含X-ray和裸下著

Files

Comments

No comments found for this post.