cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Simple Search

acs_alan
1-Newbie

Simple Search

Hi,

I am struggling to perform what would appear to be a simple operation. I have scoured the 'Macro Language Reference' without any success!

I am wanting to search the current activeDoc and remove all the text elements that contain the letter 'x'.

All the examlpes I can find involve generating something from new and assigning to a variable:

MACRO globalsTest
gText = "Hi, I'm a global."
MESSAGE gText
END MACRO

In this case I dont know to make anything from new - I want to access pre-existing elements put them into a variable and modify/delete them as needed - I am getting really frustrated at not being able to find this info - maybe I have been looking at too much code recently and I am just not seeing it!

Can anyone help?

Thanks in advance

Alan

Message was edited by: Alan Porter

1 REPLY 1

Ok for those, like myself that may have struggled with something similar, this is the solution (SELECT IF):

Macro Search

SELECT IF TEXT CONTAINS "x"

End Macro

In this example all TEXT elements will be selected IF it CONTAINS the letter "x".

In the Macro Language Reference go to 'Page 64' their are various other filters you can apply. Pretty neat command.

Hope this helps others.

Alan

P.S

I decided to go one step further to make this script more efficient:

Macro Find_Text

DEFINE userInput AS string

userInput = GET STRING "Please enter the text you wish to search for"

SELECT IF TEXT CONTAINS userInput

End Macro

Top Tags