Skip navigation
SimonSchneider
Currently Being Moderated

Metric and Imperial system

Jul 12, 2012 4:01 AM

Tags: #script #cs5.5 #inches #conditional_text #metric #imperial #mm

Hello,

This has probably been brought up befor but i would like to do this in a certain way.

 

I have a catalogue of about 300 pages with some measurements on each page. These measurements are all in mm but not all of them are labeled mm ("2 mm) some are also just a number.

 

The Idea i have is to make a script wich does the following.

 

  • I select a measurement, either with mm or without
  • I start the script
    • It will take the numeric value in the selection and apply a premade "mm"-conditional text tag to it
    • Then it will convert the numeric value from mm to inches and write this value directly after the mm value
    • now it will check if the mm value had an actual mm unit after it. if so it will write " in" after the inch value.
    • Now it will apply a premade "inch"-conditional text to the inch value and if available " in"
  • The script is now done and i have the option to show either mm or inches in the catalogue.

 

This would only require me to once go through the catalogue and select the mm values and run the script.

Prefferably it should work to select complete tables with only numeric mm values in them and it should to that to every value instead of having to select each cell for itself.

 

The problem is i have the idea but not the knowledge of the coding, i would need some help with that. Just the basic commands i should be using.

Any help would be appriciated.

 

Kind regards

Simon

 
Replies
  • Currently Being Moderated
    Jul 12, 2012 4:39 AM   in reply to SimonSchneider

    Hi Simon

     

    Not a difficult problem but I don't have time for it now.

     

    However to make the part of finding the numbers on the pages easier do like this.

    1) make a new Conditional text (Bright Yellow Highlight is good)

    2) do a grep search on use Ctrl F with the grep \d+

    3) set the change format to the new Bright Yellow Highlight condition then do replace all

     

    This will highlight all your numbers for you.

     

    You can do another grep search for all the number that have mm after them and then change them to the "mm" condition

    use grep \d+\s+?(mm||millimeter)

     

    This should be helpful with the manual part of your problem

     

    Regards

     

    Trevor

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points