Change the characterstyle in all textframes

Hello all,
i have a problem in my javascript script. I want a script that check all textframes in the document and it have to check the characterstyle from each char.
If there is a "-" in the text, the characterstyle will switch to normal. The problem is that i did not find the text in the textframe with the javascript. I´m new in the business.
I think my approach is wrong, but i can´t find an another one.  
My code :
var doc = app.activeDocument;
var tf = doc.textFrames.anyItem();
var paras = tf.paragraphs.everyItem().getElements();
var applied_style = doc.characterStyles.itemByName('Cent');
var paras_with_style = [];
for (var i=0,l=paras.length; i<l; i++) {
   var para = paras[i];
   if (para.appliedCharacterStyle == applied_style) {
      var contenttext = para.contents;
            if (contenttext == "-") {
                    para.changeTextPreferences.position = Position.normal;
  else {
                    para.changeTextPreferences.position = Position.superscript;
Thanks for your help
Greets Alex

Hi Alex
You should use Greps, read Peter Karhels book on it.
See if the below does what you want.
Trevor
var doc = app.properties.activeDocument && app.activeDocument;
app.findTextPreferences = app.changeTextPreferences = null;
app.findTextPreferences.appliedCharacterStyle = 'Cent';
app.findTextPreferences.findWhat = '-';
app.changeTextPreferences.position = Position.NORMAL;
doc.changeText();

Similar Messages

  • How can I change the year of an album in itunes11 without changing the years of all titles?

    How can I change the year of an album in itunes11 without changing the years of all titles. For example: the reissues of an 1982 album has a 1995 bonus track, but I want it to be sorted as an '82 album? In earlier versions, when itunes sorted my album "by year", it took the year of the first title as the album's year (which makes a lot of sense). In itunes 11, however, the /highest/ year of any title in an album is taken to be the album's year. This upsets my entire catalogue. Can this be changed, will this be changed?

    Highlight all of the songs,File>Get Info, change the genre

  • How to change the location of all fotos in the iPhoto library?

    my iPhoto 11 library is stored locally on my macbook.
    however, my fotos (the actualy bits) are stored externally on a NAS box.
    (or in other words: option "Importing: [ ] Copy items to the iPhoto Library" is not checked)
    recently i purchased a timecapsule and i now want to move all fotos from the NAS box to the timecapsule.
    i am looking for a way to batch-change the location of all fotos from let's say "/Volumes/MyNas/..." to "/Volumes/MyTimecapsule/...".
    can this be done? any ideas?
    thank you.
    ps: i know how to deal with xml and .db/.apdb files. so don't be gentle on me ;-)

    Not really unless you search the forums and find the older post describing how to hack the SQLite database to accomplish this
    Or use Aperture which can do this easily
    However if you are using your Time Capsule as a Time Machine bakcup volume it is not a good place to put your photos - if you do you have no backup of them which means that sooner of later you will lsoe them - and sooner or later TM will fill the volume and make it impossible to add photos
    LN

  • How do I change the pitch of all tracks in a session?

    I have 6-7 midi tracks in the key of "C". Now, I want to sing on this (in an audio file) with my pitch G, which means I have to change the pitch of all the tracks to G.  How do I do this? Thanks!

    Transpose either +7 or -5.
    http://documentation.apple.com/en/logicpro/usermanual/index.html#chapter=13%26se ction=29%26tasks=true

  • How do I change the color of all the text in a PDF?

    Hi.
    I have a large PDF, over 1000 pages. Some of the text is highlighted which makes it difficult to see on my preferred document background. In Acrobat XI how do I change the color of all the text in the document back to black please? Although solutions using any other software will be much appreciated too.
    I searched this forum already, and the same question was asked back in 2007 when it appears the only solution was to use an expensive third party plugin.
    Thanks.

    I know of no new solutions since 2007 except the ones you found.
    You could use the Accessibility Preferences > Change Document Colors to choose a text color. However, this is an individual preference and cannot be set as a default for others opening the document.

  • How can I change the settings of all instances of a particular effect?

    I've applied the same color correction effect to a lot of clips in the timeline. Now I want to fine tune the color correction (same setting for all clips still). How can I change the setting of all instances of the color correction effect without going into each clip manually?
    Looking forward to your thoughts on this!! Go on and save my cold winter editing day ...

    I was first hoping for File> New > Adjustment layer, but it's always greyed out. I thought that would create an adjustment layer, maybe I'm misunderstanding something? Anyway, if I create a black video stump and then right click it and choose "Adjustment layer", it will turn into one, and everything works as it should with that. If the black video become adjustment layer is placed on a video track atop my video, and I add for example color correction to it, it will be applied to the videos below.

  • On iMovie 10.0.7 how can I change the duration of all of my photos in the project at once?

    On iMovie 10.0.7 how can I change the duration of all of my photos in the project at once?

    You can set the default duration of stills but you have to do it before you start the project. 
    iMovie is not really suitable for stop motion videos and iMovie 10 is worse than iMovie 9 because the minimum still duration is not really controllable as you have found.   I don't have experience of making such videos but there are 3rd party apps which appear more suited to this, for example http://www.macworld.com/article/1146623/stop_motion_Mac.html
    mentions some of them, though its a bit old and you may be able to find more up to date information.
    Geoff.

  • Changing the Owner of all Objects in Instance ?

    How to Change the Owner of all Objects in Instance, like for example the Procedure: sp_changedbowner in an MS-SQL-Database, who changed the Owner of the actual Database !
    I'am looking for another possibility to do it by export the Datbase and import as new Owner !

    Hi Laurent Schneider
    OCM DBA, I successfully run:
    connect SYS/&2 as SYSDBA;
    Update sys.obj$ set owner#=(Select USER# from sys.user$ where NAME = '&4')
    where owner#=(Select USER# from sys.user$ where NAME = '&3');
    commit;
    Afterwards I dropped the &3 User CASCADE and then created the &3 User with less rights ! Before Update-Command the &4 User shouldn't be the Owner of any Object ! At Last I'm not sure that is the right way ?!

  • How to change the header in all pages at once?

    I'm new to iWeb and can't figure out how to change the headers of all pages without having to go through and do it to every page. There should be a way, but is this a feature iWeb doesn't have?

    Hi,
    Refer following link which states how to change the Page Setup setting (just an addition to above poster's explanation):-
    http://docs.oracle.com/cd/E12825_01/epm.111/fr_user/frameset.htm?1900.html
    Regards,
    Edited by: 918547 on Dec 14, 2012 6:17 PM

  • After setting up my new 4S restoring a backup of my old one, I've renamed the old 3GS in iTunes and changed the content, deleting all my important stuff. Now I'm syncing the old one to my PC. Can I then backup my NEW 4S to  iCloud without messing up all-?

    After setting up my new 4S, restoring a backup of my old 3GS, I've renamed the old 3GS in iTunes and then I've changed the content, deleting all my important stuff. Now I'm syncing the old one to my PC. Can I then after that safely backup my NEW 4S - which now holds all my company information and stuff - to  iCloud without risking to lose it?

    Hi Mcchen425,
    Welcome to the Support Communities!
    As a precaution, I would suggest backing up your iPhone to your computer via iTunes as well as iCloud.  Then you can delete one of your two backups.  The article below will explain all of your options for deleting data or backups from your iCloud storage.
    iOS: Back up and restore your iOS device with iCloud or iTunes
    http://support.apple.com/kb/ht1766
    iCloud: Managing your iCloud storage
    http://support.apple.com/kb/ht4847
    Cheers,
    - Judy

  • Is there a way to change the font of all text in all layers all at the same time in

    I'm wondering if there is a way to change the font of all text in all layers all at the same time in Illustrator CS5.

    From the menu...... Type > Find Font

  • How can I change the duration for all clips in iMovie 10.2

    How can I change the duration for all clips in iMovie 10.2?  I'm used to working in the older version of iMovie where all I had to do was click on the gear on the clip and change the duration. ALso could use the tool bar to set the duration for all clips. Can't figure out how to do that in this new version. Any suggestions would be appreciated.

    In the timeline select the clip whose duration you want to change. Click the adjust button at the top of the viewer and then click the i button and you can set the duration. For multiple clips select them all and in the i button type in the duration you want and it will be applied to all the selected clips. You can also change the duration of a clip in the timeline by putting the cursor over the beginning or end of a clip and dragging. A popup will show the new duration.

  • How to change the template of all my title pages

    ok i made a film using cs4
    with 20 seperate title pages all the title
    pages started from the same title template
    what i want to know is :-
    is it possable to change the properties of all the title pages at the same time
    for instance change the font / or font colour of all titles with one or two clicks
    rather than me go through each title page separately
    cheers

    ok
    so are you saying that in the future
    if i was to make all my titles from THE SAME template AND using the "based on current" function
    i would then be able to make adjustments to the first title in the project panel and the adjustments would be reflected on all titles  throughout the timeline

  • Can you change the year of all songs in an album without changing the year of the album?

    Hi everyone,
    I was wondering if it is possible to change the year of all the songs within an album while keeping the year of the album. This is particularly relevant in 'Compliation' or 'Best of' albums, where all the years the songs were produced is different o the year the album was produced.
    Foe example, The Beatles' best of album '1' was created in 2000, but all of the songs were from 1963-70. In iTunes, the album is listed as being released in the year 2000, which is correct, but all of the songs are listed as being released in 2000, too, which is incorrect. However, when I change all of the individual songs to their correct year in which they were created, the year of the album also changes to that of the first song on that album. In short, either the album year is correct but all the song years are incorrect OR the album year is wrong but all the song years are right.
    Does anyone kinow if there is anyway to change this or get around this?
    Many thanks!

    Hendylele wrote:
    Do you have any idea whether or not Apple are seeking to do anything about it in any upcoming updates?
    None at all. If you'd like them to consider it you'll need to use the feedback link I gave above.
    A long standing bug bear for some is not being able to correctly sort two albums released in the same year by the same band. Having both copyright date and release date would (if implemented properly) give the option to sort, or filter tracks on either date as required.
    iTunes is a database of tracks. Albums don't really exist separately. There are a few collective properties. Year can have a separate value in each track but obviously only one value can (or at least should) be used when sorting as Album by Artist/Year. If you change the album rating of a single track in iTunes (which can be done with a script) iTunes automatically updates all the others to match.
    tt2

  • Change the Background on all the 7911 phones

    Hello,
    I want to change the background on all my Cisco 7911 (Cisco by my company logo) without the users have to make it on the phones 
    How i can change on all the phones ?
    Best regards 

    Hi,
    The only way to do this remotely for all phones is using a 3rd Party application such as PhoneView from UnifiedFX (http://www.unifiedfx.com)
    Here is a short video (2 min) that covers the product:
    http://youtu.be/HYwhKw7UAMY

Maybe you are looking for

  • How can I set up 3 different VLANs on Cisco 5508

    Dear  Community Members,   I have a need to setup three (3) VLANs with different SSID's for students , staff and visitors in a  College. The controller is Cisco 5508  with Cisco 3502E-E-K9 AP presently the wireless  network is flat with just one VLAN

  • Using iTunes from nas as streaming service

    Hi I would like to know if Apple, like the Linux community, have found a way to stream video and music from iTunes library place on a NAS drive so that You don't have to have Your AirBook or MacBook open and running as well. I have been informed that

  • CP4 just stopped recording audio (on Win 7 64-bit)

    I know this has been addressed here and there, but I recorded a short webcast last week with minor audio issues (had to rename the dll file, etc), but after that, the program worked fine. Now, in wanting to edit the audio, CP4 is not recognizing the

  • Unable to download update to Abode Creative Cloud

    When I open ACC on my desktop, it starts to load and then I get a message that there is a new update available. I then get the message to click to download and then I get an error message tell me that I must be connected to the internet. BUT I AM, wi

  • Forced landscape rotation problem

    Hi all, like many others im having problems implementing forced landscape rotation. My app allows a user to select/take a photo. If the photo was taken in landscape orientation then I force the user to view it in landscape orientation. I have finally