Extension error if DW is not restarted between uses

Ask a Question related to Macromedia Exchange Dreamweaver Extensions, Design and Development.

  1. #1

    Default Extension error if DW is not restarted between uses

    DWMX 2004 on a WinXP pro SP2 box. I am not running as superuser, but I'm also
    only adding this script to my personal config folder.

    The extension is a very simple JS designed to automate some redundant
    find/replaces when cleaning up code in documents converted to HTML from within
    Quark.

    When I start Dreamweaver and run the script, it works with no error. I can
    even run several similar extensions in a row. But try to run the script a
    second time on a new document without closing and restarting Dreamweaver, and
    rather than performing those nice automated find/replaces, the script throws
    this into the head of the document, then does nothing:

    <head>
    <title>Cleanup</title>
    </head>
    <body>
    </body>
    </html>

    I'm developing this for a team of people that are not going to want to have to
    restart DW every time they work on a new document.

    This is probably something simple that I'm just overlooking. Code is below.
    Any ideas?

    _______

    <html>
    <head>
    <title>Cleanup</title>
    <script language="javascript">
    var counter = 0
    var dom=dw.getDocumentDOM();

    var mddfind = new Array()
    mddfind[0] = "?"
    mddfind[1] = "?"
    mddfind[2] = "?"
    mddfind[3] = "?"
    mddfind[4] = "?"
    mddfind[5] = "?"
    mddfind[6] = "?"
    mddfind[7] = "?"
    mddfind[8] = "?"
    mddfind[9] = "?"
    mddfind[10] = "?"
    mddfind[11] = "?"
    mddfind[12] = "?"
    mddfind[13] = "?"
    mddfind[14] = "?"
    mddfind[15] = "?"
    mddfind[16] = "?"

    var mddrep = new Array()
    mddrep[0] = "\'"
    mddrep[1] = "\'"
    mddrep[2] = "\""
    mddrep[3] = "\""
    mddrep[4] = "\—"
    mddrep[5] = "\&#181;"
    mddrep[6] = "\&#177;"
    mddrep[7] = "\&#176;"
    mddrep[8] = "\&#174;"
    mddrep[9] = "\&#169;"
    mddrep[10] = "\&trade;"
    mddrep[11] = "\&#188;"
    mddrep[12] = "\&#189;"
    mddrep[13] = "\&#190;"
    mddrep[14] = "..."
    mddrep[15] = "&euro;"
    mddrep[16] = "&#167;"

    //Make sure we're in code view
    dom.setView("code")

    while (counter < mddfind.length) {
    //get a value to find
    var mddfindstring = mddfind[counter].toString()
    //get a value to replace
    var mddrepstring = mddrep[counter].toString()

    dreamweaver.setUpFindReplace({searchString: mddfindstring, replaceString:
    mddrepstring, searchSource: true, ignoreWhitespace: true});
    dreamweaver.replaceAll()

    counter++}

    dreamweaver.setUpComplexFindReplace('<dwquery><que ryparams><find><qtag
    qname="font"></qtag></find><replace action="stripTag"/></dwquery>');
    dreamweaver.replaceAll()

    </script>
    </head>

    <body>
    </body>
    </html>

    must_be_user_error Guest

  2. Similar Questions and Discussions

    1. Your computer must be restarted ....
      This is the error I keep getting after I installed Shockwave "Your computer must be restarted in order to complete the installation of Shockwave...
    2. Coldfusion Service to be restarted after each SQLCluster failover
      :confused; We have Windows 2003 Servers (Std) with IIS 6.0 . Our backend is a clustered windows 2003 Ent environment, running an SQL 2005 Database....
    3. Cron Not Restarted
      While we have cron listed in inittab, it occasionally dies and does not restart. I have to start it with "nohup /usr/sbin/cron &" manually as...
    4. Persistent connection extension not freeing connections until serveris restarted
      Hi all, I have a fairly advanced question regarding writting modules that create persistent resources: I've written a module very similar to...
    5. Application restarted
      Hello Everyone, I have a ASPNET application which does some file operation under application folder. Sometime this file operation causes the...
  3. #2

    Default Re: Extension error if DW is not restarted between uses

    I notice that you execute the JS inline. I think this is the problem,
    because DW loads extensions only once per session and then stores them
    for subsequent use. Try placing your JS in a function and then calling
    it in <body onLoad="yourfunc()">.

    There is a lot of code in the Configuration folder, so search through
    for some examples.

    Hope this helps,
    Randy


    must_be_user_error wrote:
    > DWMX 2004 on a WinXP pro SP2 box. I am not running as superuser, but I'm also
    > only adding this script to my personal config folder.
    >
    > The extension is a very simple JS designed to automate some redundant
    > find/replaces when cleaning up code in documents converted to HTML from within
    > Quark.
    >
    > When I start Dreamweaver and run the script, it works with no error. I can
    > even run several similar extensions in a row. But try to run the script a
    > second time on a new document without closing and restarting Dreamweaver, and
    > rather than performing those nice automated find/replaces, the script throws
    > this into the head of the document, then does nothing:
    >
    > <head>
    > <title>Cleanup</title>
    > </head>
    > <body>
    > </body>
    > </html>
    >
    > I'm developing this for a team of people that are not going to want to have to
    > restart DW every time they work on a new document.
    >
    > This is probably something simple that I'm just overlooking. Code is below.
    > Any ideas?
    >
    > _______
    >
    > <html>
    > <head>
    > <title>Cleanup</title>
    > <script language="javascript">
    > var counter = 0
    > var dom=dw.getDocumentDOM();
    >
    > var mddfind = new Array()
    > mddfind[0] = "?"
    > mddfind[1] = "?"
    > mddfind[2] = "?"
    > mddfind[3] = "?"
    > mddfind[4] = "?"
    > mddfind[5] = "?"
    > mddfind[6] = "?"
    > mddfind[7] = "?"
    > mddfind[8] = "?"
    > mddfind[9] = "?"
    > mddfind[10] = "?"
    > mddfind[11] = "?"
    > mddfind[12] = "?"
    > mddfind[13] = "?"
    > mddfind[14] = "?"
    > mddfind[15] = "?"
    > mddfind[16] = "?"
    >
    > var mddrep = new Array()
    > mddrep[0] = "\'"
    > mddrep[1] = "\'"
    > mddrep[2] = "\""
    > mddrep[3] = "\""
    > mddrep[4] = "\—"
    > mddrep[5] = "\&#181;"
    > mddrep[6] = "\&#177;"
    > mddrep[7] = "\&#176;"
    > mddrep[8] = "\&#174;"
    > mddrep[9] = "\&#169;"
    > mddrep[10] = "\&trade;"
    > mddrep[11] = "\&#188;"
    > mddrep[12] = "\&#189;"
    > mddrep[13] = "\&#190;"
    > mddrep[14] = "..."
    > mddrep[15] = "&euro;"
    > mddrep[16] = "&#167;"
    >
    > //Make sure we're in code view
    > dom.setView("code")
    >
    > while (counter < mddfind.length) {
    > //get a value to find
    > var mddfindstring = mddfind[counter].toString()
    > //get a value to replace
    > var mddrepstring = mddrep[counter].toString()
    >
    > dreamweaver.setUpFindReplace({searchString: mddfindstring, replaceString:
    > mddrepstring, searchSource: true, ignoreWhitespace: true});
    > dreamweaver.replaceAll()
    >
    > counter++}
    >
    > dreamweaver.setUpComplexFindReplace('<dwquery><que ryparams><find><qtag
    > qname="font"></qtag></find><replace action="stripTag"/></dwquery>');
    > dreamweaver.replaceAll()
    >
    > </script>
    > </head>
    >
    > <body>
    > </body>
    > </html>
    >
    Randy Edmunds Guest

  4. #3

    Default Re: Extension error if DW is not restarted between uses

    These answers are brilliant and are the best answers you are going to get

    [url]http://www.cozzieworld.com/[/url] play games, look at media, have free membership with many benefits right here at cozzieworld
    www.cozzieworld.com Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139