joshbduncan / AiCommandPalette

Adobe Illustrator Command Palette
https://joshbduncan.com/software.html
MIT License
37 stars 4 forks source link

selectTool #6

Closed creold closed 2 years ago

creold commented 2 years ago

The app.selectTool() method was added in Adobe Illustrator v24 (CC 2020). But users of earlier versions (CC 2019, 2018, etc) don't know such details and will get an error like this: Adobe Area Type Tool. ReferenceError: app.selectTool is not a function.

I had an idea that could check the version of Adobe Illustrator in the script:

var aiVers = parseInt(app.version);
if (aiVers < 24) ... 

And then don't show showBuiltInTools() in Settings and search field. If the user has more than one version of Adobe Illustrator installed: created a custom workflow in Ai CC 2022 with a built-in tool call, and then ran the script in Ai CC 2019, then yes will get a ReferenceError. You can add to the error text a hint that Adobe Illustrator <put version> doesn't support built-in tools. Then the .csv of the localizations will also be updated.

It gives more clarity to the user. What do you think?

joshbduncan commented 2 years ago

Yeah, I like this. When I recently added the menu command "Window > History", I wondered if I should check on the user version since that was only just released in v26.4. I'm going to create a branch and work both of these situations out. I'll keep you updated. Thanks for the clarity!

joshbduncan commented 2 years ago

@creold, check out the PR I just submitted for this and let me know your thought. Notes are in the PR. Thanks!