Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Script calculating a given size of area for a given object

Explorer ,
Jun 01, 2023 Jun 01, 2023

I work a lot with car decals and designs in illustrator. It would help a lot with a script which would calculate the area in square meters for given objects. For now i have to manually calculate and punch the actual numbers on a calculator. Time consuming. Should be easy to extrat this data from the program some how. Does anyone now if it exists a script for this?

TOPICS
Draw and design , Scripting , Tools
2.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

Community Expert , Jun 01, 2023 Jun 01, 2023
Translate
Community Expert , Jun 01, 2023 Jun 01, 2023

I'm not sure I'd trust Word to save actual plain text regardless of what it says.

Either use an actual text editor or go to the URL for the raw text on Git and save the page directly:

https://gist.githubusercontent.com/bryanbuchanan/11387501/raw/dcdf4810bce2e62c7bf14c4a54ace3d692410fec/GetShapeArea.jsx

Translate
Adobe
Community Expert ,
Jun 01, 2023 Jun 01, 2023
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 01, 2023 Jun 01, 2023

I just saw you in that Git thread Jacob and thought I might find you here.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 02, 2023 Jun 02, 2023
LATEST

And you did, Doug (late in spotting htis).

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 01, 2023 Jun 01, 2023

Looks very promising, but for some reason my illustrator is not allowing me to run this .jsx file. have absolutely no idea why. Running up to date version of illustrator. Older scripts seems to be working but this "newer" file is not available to click. Just greyed out. Any idea why?

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 01, 2023 Jun 01, 2023

Seems to run fine here on AI 27.5, Windows 11.

What are the exact steps you're taking to run it?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 01, 2023 Jun 01, 2023

I am saving the file in a "script folder" on my desktop with the file extenscion as described. In illustrator - 

File - Scripts - other Scripts and navigating to the right folder on my desktop. This new script is visible but not available. As noted earlier older scripts are available.

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 01, 2023 Jun 01, 2023

MacOS Monterey apple M1 - AI 27,5

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 01, 2023 Jun 01, 2023

How did you save it exactly? Paste into a text editor? Direct from the Raw page?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 01, 2023 Jun 01, 2023

Yep. copy paste. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 01, 2023 Jun 01, 2023

Which text editor? Did you save it as plain text? TextEdit saves Rich text by default which won't work for a script.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 01, 2023 Jun 01, 2023

Microsoft Word saved as plain text. On save It is a dialogue box with a number of options.  I have tried all of them. No success.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 01, 2023 Jun 01, 2023

I'm not sure I'd trust Word to save actual plain text regardless of what it says.

Either use an actual text editor or go to the URL for the raw text on Git and save the page directly:

https://gist.githubusercontent.com/bryanbuchanan/11387501/raw/dcdf4810bce2e62c7bf14c4a54ace3d692410f...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 01, 2023 Jun 01, 2023

Used Safari to save the code. Worked fine. Thanks!

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 01, 2023 Jun 01, 2023

There is a script here that does just that:

https://gist.github.com/bryanbuchanan/11387501

 

Readsing the thread on that git page, another user seems to have adapted it with ScriptUI and selectable units:

https://github.com/schroef/Illustrator-Scripts/blob/master/GetShapeArea-dialog-v005.jsx

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines