I need help writing a script that finds the first instance of a paragraph style and then changes it

I need help writing a script that finds the first instance of a paragraph style and then changes it to another paragraph style.  I don't necessarily need someone to write the whole thing, by biggest problem is figuring how to find just the first instance of the paragraph style.  Any help would be greatly appreciated, thanks!

Hi,
Do you mean first instance of the paragraph style
- in a chosen story;
- on some chosen page in every text frames, looking from its top to the bottom;
- in a entire document, looking from its beginning to the end, including hidden layers, master pages, footnotes etc...?
If story...
You could set app.findTextPreferences.appliedParagraphStyle to your "Style".
Story.findText() gives an array of matches. 1st array's element is a 1st occurence.
so:
Story.findText()[0].appliedParagraphStyle = Style_1;
//==> this will change a paraStyle of 1st occurence of story to "Style_1".
If other cases...
You would need to be more accurate.
rgds

Similar Messages

  • [JS] [CS3] Finding the longest instance of a paragraph style

    I'm pretty new to JS but I'm trying to write a script that will return the longest instance of each paragraph style in a manuscript (which has been imported into InDesign). Currently, my script lists all the paragraph styles found in the document and puts them in a new document. My next thought was to loop through the style names array and find the longest instance.
    Could anyone point me in the right direction on how to do this?
    Any help is much appreciated. I'm learning a lot reading this forum.

    Your question is slightly ambiguous. Do you mean you are looking for the longest instance of a paragraph in that paragraph style? That's the most likely meaning. Or are you looking for the longest run of text in that style? Because that's what you'll find if you're not careful in your script.
    The essence of the script would be:
    1. Setup a FindText for the paragraph style in question (or each style if you're looping through them all).
    setupFindText(); // use function to setup the find -- search this forum on setupFindText to find it
    app.findTextPreferences.appliedParagraphStyle = myStyle; // where myStyle is the style in question
    2. Issue the find getting all the references into a variable.
    var myFinds = app.documents[0].findText();
    3. Loop through all the finds to locate the longest paragraph.
    var longestLength = 0;
    var longestPara = null;
    for (var j = myFinds.length - 1; j >= 0; j--) {
         myParas = myFinds[j].paragraphs;
         for (var k = myParas.length - 1; k >= 0; k--) {
              myPara = myParas[k];
              if (myPara.length > longestLength) {
                   longestLength = myPara.length;
                   longestPara = myPara;
    4. Make sure that longestPara is not null (no instances found); If not, then longestPara is a reference to the longest instance
    Dave

  • Need help writing a script

    I am trying to convert my prcess from DTS to SSIS. I am running this report out of SAP and then using Monarch to put into the correct form, then I am using the DTS to put it into the database on the SQL server.  I am able to get all the other info to
    move out having so much trouble here to get the plant number. The issuse is that it is on top on the page and it will change when a new plant is needed.
    Thanks for any help
    I need help wrting a script that will put that 7010 into a cloumn nnamed plant number.

    To convert from DTS packages to SSIS you can just open the DTS package in a new SSIS project (depends on target SSIS version by using SSDT or BIDS).
    The rest is mechanics how the iteration with SAP is done and may be beyond the scope of this forum.
    Arthur
    MyBlog
    Twitter

  • I am running 10.5.8 and want to make use of the icloud changeover, I understand that I must first buy snow leopard 10.6 and then buy lion 10.7. Do I buy these as upgrades versions or full versions? I am not very techie, thanks for anya advice

    I am running 10.5.8 and want to make use of the icloud changeover, I understand that I must first buy snow leopard 10.6 and then buy lion 10.7. Do I buy these as upgrade versions or full versions? I am not very techie, thanks for any advice.

    A 10.5 era machine is better left on 10.6.8
    I don't advise upgrading it to 10.7 as you'll have to buy all new versions of software for a older model machine, some are not ready yet and some of your third party driver software may not be available for your other hardware.
    10.7 is slower and requires 4GB of RAM actually.
    10.8 is being released this summer and it won't run on certain older graphic cards, so shortly you will be behind again.
    Save your money for a new 10.8 machine. IMO
    These rapid OS X upgrades are for those who like to be on the cutting edge and can afford to buy new hardware often, you didn't even upgrade to 10.6, so your not that sort of person obviously.
    But you do need to upgrade to 10.6 for security issues and faster video. It will run your 10.5 Rosetta software, but 10.7 will not.
    http://roaringapps.com/apps:table
    https://discussions.apple.com/community/notebooks/macbook_pro?view=documents

  • Need help writing a query that generates sequential tokens

    Updated example to accomodate duplicates in cacard and to change the #temp_tokentable.cccard to varchar(20).
    I am just having a block. I have a should be easy task, and have looked at it several ways, but cannot come up with some tsql that I would not be embarressed to show coworkers.
    This is a the simplistic example of what needs to get done - 
    cacard table has credit cards. need to replace all credit cards with a generated token. the token is generated by just adding 1 to the lasttokenused and then + the right(creditcard, 4). Then the token and clear credit card values are inserted into
    tokentable.
    cacard can be a rather large table (# of rows and wide) in production so need to be as efficient as possible. But it is a onetime conversion program.
    Thanks for any help
    IF OBJECT_ID('tempdb..#Temp_cacard') IS NOT NULL
    DROP TABLE #Temp_cacard
    IF OBJECT_ID('tempdb..#Temp_tokentable') IS NOT NULL
    DROP TABLE #Temp_tokentable
    IF OBJECT_ID('tempdb..#Temp_lasttokenused') IS NOT NULL
    DROP TABLE #Temp_lasttokenused
    Create table #temp_cacard (ccard numeric(19,0))
    Insert into #temp_cacard values (1234567891234567), (2344567890123456789),(3456789012345678900), (1234567891234567)
    Create table #temp_tokentable (token varchar(20), ccard varchar(20))
    Create table #temp_lasttokenused (token varchar(20))
    Insert into #temp_lasttokenused values ('081111111111111111')
    want to end up with
    CACARD
    08111111111111124567
    08111111111111136789
    0811111111111114890008111111111111124567
    tokentable
    08111111111111124567 1234567891234567
    08111111111111136789 2344567890123456789
    08111111111111148900 3456789012345678900
    lasttokenused
    0811111111111114

    Thought that I would post the code that reads a credit card number file and replaces card numbers
    with token values. The tokens keep the last 4 of the original credit card number. I have two example card number tables. One table -cacardn - has a numeric(19,0) card number and the other - cacardv - has a varchar(20) card
    number. My shop has credit card numbers defined as both. Obviously, another step after this runs is to encrypt the #token.data column.
    IF OBJECT_ID('tempdb..#cacardn')IS NOT NULL
    DROP TABLE #cacardn;
    IF OBJECT_ID('tempdb..#cacardv')IS NOT NULL
    DROP TABLE #cacardv;
    IF OBJECT_ID('tempdb..#Token')IS NOT NULL
    DROP TABLE #Token;
    IF OBJECT_ID('tempdb..#Temp_Token')IS NOT NULL
    DROP TABLE #Temp_Token;
    IF OBJECT_ID('tempdb..#LastToken')IS NOT NULL
    DROP TABLE #LastToken;
    -- cardnumber table that has numeric (19,0) card numbers
    Create Table #cacardn ([cccard] numeric(19,0))
    INSERT INTO #cacardn ([cccard]) VALUES
    (NULL),
    (0),
    (1111),
    (91111111111121112),
    (1111),
    (1113),
    (91111111111201120);
    -- carnumber table that has varchar(20) card numbers
    Create Table #cacardv ([cccard] varchar(20))
    INSERT INTO #cacardv ([cccard]) VALUES
    (NULL),
    ('0'),
    ('00000000000000001111'),
    ('00091111111111121112'),
    ('00000000000000001111'),
    ('00000000000000001113'),
    ('00091111111111201120');
    -- token table that has tokens, varbinary card numbers, data type (13-20) are card numbers
    Create Table #Token (
    [token] varchar(20),
    [data] varbinary(256),
    [type] int)
    INSERT INTO #Token ([token],[data],[type]) VALUES
    ('00000000000000000000', CAST('00000000000000000000' as varbinary), 13),
    ('', CAST('' as varbinary), 13),
    ('0', CAST('0' as varbinary), 13),
    ('00091111111111111111', CAST('00000000000000001111' as varbinary), 13),
    ('00091111111111121112', CAST('00000000000000001112' as varbinary), 14),
    ('00091111111111201120', CAST('00000000000000001120' as varbinary), 20)
    -- Temporary, Intermediate table
    CREATE TABLE #Temp_Token(ClearValue varchar(128));
    SELECT * INTO #LastToken from (
    SELECT '0009111111111150') d (lastgeneratedToken)
    -- Create an entry in the Temp_Token table for entries in the card number field that do not match the Token table token or
    -- Token table data values. These must be card number clear values.
    -- ++ change from #cacardv to #cacardv to test both numeric and varchar card numbers
    -- ++ the card number field must not NULL, not = 0 and numberic values
    INSERT INTO #Temp_Token
    SELECT DISTINCT cccard
    FROM #cacardv l
    WHERE cccard IS NOT NULL and CAST(cccard as varchar) <> '0' and CAST(cccard as varchar) not like '%[^0-9]%' and
    NOT EXISTS (SELECT 1 FROM #Token s
    WHERE (right('00000000000000000000'+ rtrim(cccard), 20) = [token] or
    CAST(right('00000000000000000000'+ rtrim(cccard), 20) as varchar) = CAST([data] as varchar)) and
    [type] in (13,14,15,16,20))
    DECLARE @lastgeneratedToken varchar(20) = (SELECT lastgeneratedToken from #LastToken)
    -- Update the last token used
    UPDATE ifs_EDLastTokenUsed
    SET EDToken = RIGHT('0000000000000000' + CAST(@lastgeneratedToken + CAST(@@RowCount AS numeric)AS varchar), 16);
    -- Insert into the Token table
    INSERT INTO #Token
    SELECT DISTINCT RIGHT('0000000000000000' + CAST(@lastgeneratedToken + ROW_NUMBER() OVER (ORDER BY ClearValue) AS varchar(20)) + RIGHT(ClearValue,4), 20),
    CAST(RIGHT('0000000000000000' + ClearValue, 20) as varbinary), 13
    FROM #Temp_Token
    -- Now Update the card number field that matches the Token data field with the Token token field.
    -- ++ change from #cacardv to #cacardv to test both numeric and varchar card numbers
    -- ++ Do not undate NULL, 0, or non-numeric card numbers (they are invalid values)
    UPDATE c
    SET c.cccard = s.[token]
    FROM #cacardv c inner join (SELECT DISTINCT cccard, Cast([token] as varchar) as [Token]
    FROM #cacardv l inner join #Token s
    ON RIGHT('0000000000000000' + CAST(l.cccard as varchar), 20) = CAST(s.[Data] as varchar)
    WHERE [type] in (13,14,15,16,20)) s
    on c.cccard = s.cccard
    WHERE c.cccard IS NOT NULL and CAST(c.cccard as varchar) <> '0' and CAST(c.cccard as varchar) not like '%[^0-9]%'
    -- Check the Results
    select * from #cacardv
    Any comments or suggestions would be appreciated. (this is not the exact code. but the main statements are represented.)
    Wonder about my WHERE clauses that seek to exclude junk data (IS NOT NULL, <> '0', and numeric only data), shhould the WHERE close be on the inner or outer WHERE?

  • Need help writing a script to traverse through files in a directory

    I want to go through a directory and sub directories and convert files into jpg ones
    I have this code I've been using: mkdir jpegs; sips -s format jpeg *.png --out jpegs
    This is great for one directory at a time
    But, what I want is to apply this to all sub directories, create a jpeg directory in each of the sub directories and then create jpg's and put them in there
    I'm not sure where to start
    Should I be looking for 'scripting in linux'?
    Thanks
    Omar

    Hello
    You may also try something like this. Set DIR to the root directory to start the search.
    #!/bin/bash
    #     convert png to jpeg and put jpeg in jpegs sub-directory
    DIR=~/Desktop/test
    while read -d $'\0' f
    do
        d=${f%/*}/jpegs
        [[ -d "$d" ]] || mkdir "$d"
        sips -s format jpeg "$f" --out "$d"
    done < <(find "$DIR" -type f -iname '*.png' -print0)
    In case, here's an AppleScript wrapper:
    set f to (choose folder with prompt "Choose root folder to process")'s POSIX path
    if f ends with "/" then set f to f's text 1 thru -2
    do shell script "/bin/bash -s <<'EOF' -- " & f's quoted form & "
    #     convert png to jpeg and put jpeg in jpegs sub-directory
    DIR=\"$1\"
    while read -d $'\\0' f
    do
        d=${f%/*}/jpegs
        [[ -d \"$d\" ]] || mkdir \"$d\"
        sips -s format jpeg \"$f\" --out \"$d\"
    done < <(find \"$DIR\" -type f -iname '*.png' -print0)
    EOF"
    Regards,
    H

  • [Updated topic] Need help writing a script

    Hey all!
    Got a folder with about 100 *.sql files and been trying to use the folowing python script to import them into the database:
    #!/usr/bin/env python
    import glob, os
    patches = glob.glob('*.sql')
    patches = sorted(patches)
    for x in patches:
    db = x.split("_")[2].replace('.sql', '')
    os.system("mysql -u mangos -ppassword -v " + db + " < " + x)
    But i get an error like this:
    File "/opt/mangos/sql/updates/update.py
    db = x.split("_")[2].replace('.sql', '')
    IndexError: list index out of range
    Tried different numbers instead of the [2], any clues?
    FYI not very hightech python-guru
    Last edited by Afnaf (2010-07-14 11:58:31)

    This isn't python, but here's what I do:
    1) I have a bash script called _genspscript.sh which contains the following:
    #!/bin/bash
    rm _spscript.sql
    cat *.sql > _spscript.sql
    2) Run that script and it creates a single .sql file with all the SPs in them. Then I just run that one file into MySQL.
    (Shameless plug: If you're interested I also have a Python script that will read the Schema of a DB and create the basic CRUD stored routines in individual files for all tables in a MySQL DB.)

  • Need help... can't find the problem...

    I'm trying to copmli my program.. but I'm getting
    some errors...
    C:\Umass\CS210\Hw2\SinglyLinkedList.java:301: unreachable statement
              return NOT_FOUND;
    ^
    C:\Umass\CS210\Hw2\SinglyLinkedList.java:316: variable p might not have been initialized
         return p;
    ^
    import java.util.*;
    public class SinglyLinkedList implements List
       * creatino of the SllIterator
      private class SllIterator implements Iterator
           private Node current;
           private Node lastVisited = null;
           private int expectedModCount = modCount;
         public boolean hasNext()
              if(expectedModCount != modCount)
                   throw new ConcurrentModificationException();
              return true;
         public Object next()
              if(!hasNext())
                   throw new NoSuchElementException();
              Object nextItem = current.data;
              lastVisited = current;
              current = current.next;
              return nextItem;
         public void remove()
              if(expectedModCount != modCount)
                   throw new ConcurrentModificationException();
              if(lastVisited == null)
                   throw new IllegalStateException();
              SinglyLinkedList.this.remove(lastVisited);
              lastVisited = null;
              expectedModCount++;     
      // an inner class: This is our node class, a singly linked node!
      private class Node
        Object data;
        Node next;
        Node(Object o, Node n)
          data = o;
          next = n;
        Node(Object o)
          this(o, null);
        Node( )
          this(null,null);
      private Node head; // the "dummy" head reference
      private int size;  // the number of items on the list
      private int modCount = 0;
      public SinglyLinkedList()
        head = new Node(); // dummy header node!
      public void add(int index, Object o)
                Node p = getNode(index);
                Node newNode = new Node(o, p);
                newNode.next = newNode;
                size++;
                modCount++;
      public boolean add(Object element)
           if (element == null) return false;
           // Check for dummy head node
           if (head.data == null)
                head = new Node(element, null);
        else
        // Traverse the list until we find the end
             Node next = head;
             while (next.next != null)
             next = next.next;
        next.next = new Node(element, null);
        size++;     
        return true;
      public boolean addAll(Collection c)
        return true;
      public boolean addAll(int index, Collection c)
        return true;
      public void clear()
           head = new Node("Head", null);
           size = 0;
      // write a recursive implementation here
      public boolean contains(Object o)
        return findPos(o) != NOT_FOUND;
      public boolean containsAll(Collection c)
        return true;
      public boolean equals(Object o)
        return true;
      // write a recursive implementation here
      public Object get(int index)
        return null;
      // NOT implemented: we don't cover hash codes
      // and hashing in this course
      public int hashCode()
        throw new UnsupportedOperationException();
      public int indexOf(Object o)
        return -1;
      public boolean isEmpty()
         return (size() == 0);
      public Iterator iterator()
        return null;
      public int lastIndexOf(Object o)
        return -1;
      // Not implemented: The following two operations are not supported
      // since we are using a singly linked list, which does not allow
      // us to iterate through the elements back and forth easily
      // (going back is the problem)
      public ListIterator listIterator()
        throw new UnsupportedOperationException();
      public ListIterator listIterator(int index)
        throw new UnsupportedOperationException();
      // write a recursive implementation here
      public Object remove(int index)
        return null;
      public boolean remove(Object o)
        return true;
      public boolean removeAll(Collection c)
        return true;
      public boolean retainAll(Collection c)
        return true;
      // write a recursive implementation here
      public Object set(int index, Object element)
        return null;
      public int size()
        return size;
      // NOT implemented: to keep the homework reasonably simple
      public List subList(int fromIndex, int toIndex)
        throw new UnsupportedOperationException();
      public Object[] toArray()
        return null;
      public Object[] toArray(Object[] a)
        // you'll find this piece of code useful
        // it checks the exact type of the array passed as a parameter
        // in order to create a larger array of the same type.
        if (a.length < size)
          a = (Object[])java.lang.reflect.Array.
         newInstance(a.getClass().getComponentType(), size);
        // ... you need to write more code here!
        return a;
      private static final Node NOT_FOUND = null;
      //FindPos
      private Node findPos(Object o)
           for(Node p = head.next; ; p = p.next)
                if(o == null)
                     if(p.data == null)
                     return p;
                else if(o.equals(p.data))
                return p;
                return NOT_FOUND;
      //Get Node
      private Node getNode(int index)
           Node p;
           if(index < 0 || index > size())
                throw new IndexOutOfBoundsException();
           if(index < size() /2)
                p = head.next;
                for(int i = 0; i < index; i++)
                  p = p.next;
           return p;
      //Print The node
      private static void print(Node n)
           Node current = n.next;
           while (current != null){
                System.out.println(current.data);
                current = current.next;
      public static void main (String[] args){
           System.out.println("Singly Linked List");
           System.out.println();
           SinglyLinkedList l = new SinglyLinkedList();
           l.add("F");
           l.add("K");
    }       

    C:\Umass\CS210\Hw2\SinglyLinkedList.java:301: unreachable statement
    return NOT_FOUND;
    ^
    C:\Umass\CS210\Hw2\SinglyLinkedList.java:316: variable p might not have been initialized
    return p;
    ^
    The first problem is because your "for" loop has no "while" condition in it:
    for(Node p = head.next; ; p = p.next)...
    Therefor, the only way out of the loop is via break, return, or exception. In your case, you don't "break" out of the loop, so there's no way it can get to this statement.
    The second problem, you didn't cover all cases to set "p", so it won't let you return an un-initialized value.

  • IMEI *******, CAN YOU TELL ME IF THIS DEVICE IS ON YOUR BLACK LIST? A FRIEND GAVE IT TO ME, BUT I NEED TO UNLOCKED IT, I CANT FIND THE FIRST OWNER, PLEASE HELP ME TO UNLOCKED

    PLEASE HELP TO ME TO UNLOCK THIS DEVICE, A FRIEND GIVE IT TO ME AS A GIFT, HE BOUGHT IT TO SOMEONE NEVER MEET HIM BEFORE AND LATER THE DEVICE, MY FRIEND USED IT WITH THE FIRST CONFIGURATION AND WHEN HE GAVE IT TO ME, HE RESET ALL CONFIGURATION, NOW I CANT CONTACT THE FIRST OWNER, THIS DEVICE WAS BUY IT IN USA AND ITS BEEN WORKING IN NICARAGUA, I REALLY APPRECIATE  ALL THE HELP YOU CAN GIVE TO ME...THANK YOU VERY MUCH
    <Personal Information Edited by Host>

    nmarin007 wrote:
    maybe its not an stolen device...she seems to be a honorable lady...but her people refuse to give to me her phone number...this is weird!...all her facebook  friends refuse to know her
    Probably because it's a stolen phone and you sound like some kind of criminal/stalker trying to hunt her down.
    Give up. It's useless. Thank you friend, and politely explain that the phone can not be used. Maybe they can contact whoever they got it from and get their money back.

  • Need help with java File IO ( Removing the first line from a file )

    Hi guys ,
    I am currently doing a project in which I need to extract out the values from the second line of a file to the end. The question is how do I ignore the first line ??
    I thought of two possible answers myself. One is to use randomaccessfile to read and rewrite. But the file may be HUGE so storing the whole file in memory is not a very good idea.
    Second is to jump to second line before doing while ((str = in.readLine()) != EOL) ... or just delete the first line from the file. Can anyone suggest a better solution or show me some sample codes ? Thanks.
    regards
    billyam

    Just skip the first line (bufferedReader.readLine()), add a comment, and then handle the rest of your file

  • How do I perform a trigger that collect the data for every rising edge continuously and then automatically put the data in a .xls file??

    I need to collect the data for every rising edge a trigger perfoms. So far I could collect the data but it seems that it only collect the data in the start of triggering, but not continuously. I also want to put the data in an excel spreadsheet and automatically add new set of data when the next rising edge occur. Please help.
    thanks a lot.

    LabWindows/CVI actually ships with a comprehensive set of examples for just about every area of programming you can use it in, including triggered analog data acquisition and ActiveX control of Microsoft Excel for data logging. Go to the following two directories on your computer to find respective examples for the two areas you are inquiring about:
    1) C:\MeasurementStudio\CVI\samples\DAQ\Ai\DAQsingleBufExtTrig.PRJ
    2) C:\MeasurementStudio\CVI\samples\activex\excel\excel2000dem.prj
    Just make sure to study the examples carefully so that you fully understand the processes followed for triggered analog acquisition and the process of launching an ActiveX automation server for control, and then you should be able to merge the concepts shown in both of the example
    s to make the application you desire.
    Jason F.
    Applications Engineer
    National Instruments
    www.ni.com/ask

  • [CS2/CS3 JS] Finding the first character of each paragraph

    Hi,
    Can anybody help with my script below:
    for (h=0; myParaCount>h; h++){
    myChars = myStory.paragraphs.item(h).contents;
    if (myChars.characters.item(0) == "l" && myChars.characters.item(0).appliedCharacterStyle == CharStyleWin){
    myStory.paragraphs.item(h).appliedParagraphStyle = "L-B";
    This script is supposed to test if the first character is an "l" with my character style "Wingdings" applied to it. I could not test whether the character style is "Wingdings" or not. What could be wrong with my script. Thanks.

    // You need to have a textFrame selected
    var myFrame = app.selection[0];
    var myParaCount = myFrame.paragraphs.length;
    // There must exist a paragraphStyle name L-B
    var myApplyStyle = app.activeDocument.paragraphStyles.item("L-B")
    for (h=0; h < myParaCount; h++){
    var myChar = myFrame.paragraphs.item(h).characters.firstItem();
    // check if first char is "l" and if its applied charstyle name is CharStyleWin
    if (myChar.contents == "l" && myChar.appliedCharacterStyle.name == "CharStyleWin"){
    myFrame.paragraphs.item(h).appliedParagraphStyle = myApplyStyle;
    /* Edited at 11.21 */

  • TS3276 When I add a name to the "To" box or CC/BCC box and then change my mind about sending an email to them, Mail is ignoring the instruction to "remove" so that once the email has been sent, their name is still included and the email goes to them anywa

    Can anyone help?  When sending an email and I add a name to the "To" box or CC/BCC box which I later decided I don't want to include, Mail ignores the instruction to "remove" that name so that once the email has been sent, the name is still included and the email goes to them anyway.  Pretty frustrating and I don't understand why this is happening. 

    You would really have to ask the app developer if there is a way to export the data.
    As for adding a printer, you would need to purchase an AirPrint compatible printer and connect it to your wireless network.
    By the way, your holiday letter/rant/Idon't even know what to call it... is completely inappropriate for these forums.

  • Need help writing a script to delete a folder to run at startup

    I have no experience with this and need full assistance to set this up.
    I am hoping to write a script which can be run at startup on a single client machine which is giving me font trouble. Our client machines are network controlled by our server and have multiple users all in the Server user database.
    The fonts are behaving badly until we trash this folder HD>Library>Caches>com.apple.ATS
    On restart the fonts behave as expected.
    Can someone help me write a script or give me a command I can insert in a crontab with Cronnix to delete this folder at startup?
    Thanks

    They both work fine (read that as: it can be added into either place) While that message in crontab seems to intimate that Apple will do something drastic like disable or make it hard to run cron I cannot see how, cron has been in all *nix's since the beginning so to remove it would anger quite a few people...
    Having said that, If you want to make a launchd item you would put the below into /Library/LaunchDaemons/ create a file (call it someting memorable like 'Delete_com.apple.ATS') put this into it:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Label</key>
    <string>Delete com.apple.ATS</string>
    <key>ProgramArguments</key>
    <array>
    <string>rm</string>
    <string>-rf</string>
    <string>/Library/Caches/com.apple.ATS</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    </dict>
    </plist>
    and finally load it...
    PowerMac G5 DP 2.5Ghz   Mac OS X (10.4.3)  

  • Find the first occurance of a word

    I have a script which finds and counts ALL occurances of a word.
    I need the script to find the FIRST instance of a word only.
    Can any one please advise how to modify the script to find the first instance of the word?
    Script as follows:
    var numWords = this.getPageNumWords(0);
    for (var i=0; i<numWords; i++)
    var ckWord = this.getPageNthWord(0,i);
    if ( ckWord == "MATERIAL")
    /*Script will go here based on finding the first instance of the word "MATERIAL"*/
    I have tried var CKWord = this.getPageNthWord(0,0); but console reports back is UNDEFINED?

    Thanks for your help.  Script now returns the first occurance of the word "MATERIAL".
    I know have to add to the script to find the SECOND OCCURANCE of the word "ISSUED".
    Can you please advise how I would code the script for this, ie would this have something to do with the break command?
    var numWords = this.getPageNumWords(0);
    for (var i=0; i<numWords; i++)
    var ckWord = this.getPageNthWord(0,i);
    if ( ckWord == "ISSUED")
    var coord = this.mouseX;
    var annot = this.addAnnot({
    page: 0,
    type: "Stamp",
    name: "AppStamp",
    rect: [coord+1000, 2300, 30, 2820],
    rotate: 90,
    AP: "#C94cHAFFa42U1gTH5Tug5C" }); 
    /*break; how can this be modified to break for the second occurance of the word "ISSUED"?*/

Maybe you are looking for

  • Strange Problem with a Vector wraped inside a Hashtable

    Hi all , I'm having a strange problem with a Vector wraped within a Hashtable inherited Class. My goal is to keep the order of the elements of the Hashtable so what I did was to extend Hashtable and wrap a Vector Inside of it. Here is what it looks l

  • LBWF &LUW

    HI ALL 1.what is LUW? what is the use,,& where we used ? 2.what is use of LBWF(bw log) in LO? why &where we used ? any one tell me scenario of these two pls... thnks

  • Scroll Wheel Speed in KDE, witha Razer Mouse???

    I just bought a Razer Lachesis, with the firmware on the mouse configured from drivers on my Windows install. But- How on Earth do I get the same scroll wheel speed in Arch that I do in Windows? Some apps-such as system popups (i.e. plasma widgets do

  • WebI/DeskI SIG Discussion Forum

    There is now a discussion area within the WebI/DeskI Special Interest Group of [ASUG|http://www.asug.com]. The ASUG WebI/DeskI SIG a continuation of the original GBN community of Web Intelligence and Desktop Intelligence users. The transition of this

  • Where are the "Clicks" coming from?

    After recording a voice track file, I notice in playback that there were some occasional "clicks." They seem to occur very randomly. What might be causing this and how can I solve this problem?  Thank You :-)