OnSubmit content replace

I seem to have a problem. Looking at the example here:
Adobe
Example... so does Adobe. (All IE7).
I wanted to use Spry validation and submit the form to an ASP
page which builds the html fragment for a response. I want the
response to replace the form and avoid loading the response page.
If I understand the examples the form tag should read:
quote:
<form action="validate.asp" method="post" name="contact"
onsubmit="return Spry.Utils.submitForm(this,
updateResponseDiv);">
NOTE: The ASP is only named 'validate'. It does
no validation. It trims (Left()) the incoming variables, builds and
sends an email and builds the SUCCESS or FAIL html fragments.
The page still loads the validate.asp page... I expect it NOT
to load a new page. If some part of the innerHTML is not working I
would expect the showing page (form) not to change, but still not
load the new page.
I modified this function to point to a div and revised it to
point to a span:
quote:
function updateResponseDiv(req) {
Spry.Utils.setInnerHTML('emailform',
req.xhRequest.responseText);
That was not the problem
I checked to amke sute all the functions in the thread of
calls are included.
xpath.js
SpryData.js
SpryURLUtils.js
SpryValidationTextField.js
SpryValidationTextarea.js
What am I missing?

MARIN, thanks for catching the '}'
Unfortunately that is not the problem... The page still loads
the form target/action page.
Perhaps I am confused on passing the form handle here:
Spry.Utils.submitForm(
formHandle, updateResponseDiv);
Using 'this' in the onSubmit statement works for JUST
Spry.Utils.submitForm. But passing 'this' from the onSubmit
to one of my functions with validation too fails and loads the
action page.
I've tried these 3:
quote:
function SendForm(form) {
var theForm = document.getElementById(form);
var ret = Spry.Widget.Form.validate(theForm);
if (ret) {
Spry.Utils.submitForm(theForm, updateResponseDiv);
} else {
return false;
function SendForm2(form) {
//var theForm = document.getElementById(form);
var ret = Spry.Widget.Form.validate(form);
if (ret) {
Spry.Utils.submitForm(this, updateResponseDiv);
} else {
return false;
function SendForm3(form) {
//var theForm = document.getElementById(form);
var ret = Spry.Widget.Form.validate(form);
if (ret) {
Spry.Utils.submitForm(form, updateResponseDiv);
} else {
return false;
For the first one I pass the ID ('content').
In the second I wondered if I 'this' was passing a handle for
Spry.Utils.submitForm function. While I pass the function 'this', I
used another this within the Spry.Utils.submitForm. It still loads
the action target.
In the 3rd I have the func use the passed 'this' result as
the handle in Spry.Utils.submitForm, which is what I think it
should be. BUT all 3 result in a page load.
As I Firebug step through the code I see that
Spry.Utils.submitForm will take a handle or and ID. So, I am really
confused as to why I cannot get the action page to replace my div.
I see the process move through the Utils.js to the point it makes
the call to the target, then the page loads...
I really appreciate your help. I can't see where I am going
wrong...
EDIT: I added a 4th function (you can see it in the PAGE link
above). It calls the target page without doing a page relaod and
replaces the div as intended. But the valadation does not work.
Validation is called but always returns true, even with an empty
form. Later today I'll work on it some more.
EDIT2: I find that with 4 the behavior is different in FF and
IE7...

Similar Messages

  • I downloaded CS6 Red Plug-In and added to Package Contents, replaced the current files with the new without backing up, now my RED footage thumbnails and color-correction don't WORK! How do I get my old importerRed file back!!?? HELP!

    I downloaded CS6 Red Plug-In and added to Package Contents, replaced the current files with the new without backing up, now my RED footage thumbnails and color-correction don't WORK! How do I get my old importerRed file back!!?? HELP!

    Try asking in the Premiere Pro  forum seems to be an Adobe Lab for Premiere Pro

  • Downloading ASPX files throuhg File Explorer - Why is the original content replaced?

    Hi All,
    I have hit upon this very annoying problem which is dragging down my productivity. I hope some of the experts here might be abble to offer a solution.
    My company has SP 2013 deployed. I have some custom ASPX pages deployed to a document library and these pages have no reference to anything of SharePoint at all. Everything works fine. However, when I download those files to local disk using the File Explorer
    view, the content of the ASPX pages are modified.
    If I look into the original files through SharePoint Designer then everything looks fine. Why would the File Explorer view of SharePoint do such a covert thing.
    example of modified content below:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns:o="urn:schemas-microsoft-com:office:office" lang="en-us" dir="ltr">
    <head><meta name="GENERATOR" content="Microsoft SharePoint" /><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta http-equiv="Expires" content="0" /><meta http-equiv="X-UA-Compatible" content="IE=8"/><meta name="ROBOTS" content="NOHTMLINDEX" /><title>
    Error: User Settings Not Initialized.
    </title><link rel="stylesheet" type="text/css" href="/_layouts/15/1033/styles/corev15.css?rev=5vnvqGmlkKiZE7lIH7ENng%3D%3D"/>
    <link rel="stylesheet" type="text/css" href="/_layouts/15/1033/styles/error.css?rev=nc1850SZNy60qTAeQIRxsA%3D%3D"/>
    <script type="text/javascript" src="/_layouts/15/init.js?rev=ZCyl%2Bj%2B4NZLoeodWTEXQ0Q%3D%3D"></script>
    <script type="text/javascript" src="/ScriptResource.axd?d=waxIQA_sGf4iJF1mpDQ_h_7Bnp7l3Lb3pIc6d0Qn3v2S7zRP84uas_kZlheIew9n1ZY8LsdDvP_VUtLmPewi5Lt5GXCQln0TmnIM04UIBOCbicbhxC3tMhCPYfqxnFmO3r2Hy0TZ7TjAY4dqK7ge4yZ7s4MyKLIczZOrR3Ommjfjvo6pdzF8kZB0TX-DJZjY0&amp;t=6119e399"></script>
    <script type="text/javascript" src="/_layouts/15/blank.js?rev=ZaOXZEobVwykPO9g8hq%2F8A%3D%3D"></script>
    <script type="text/javascript">RegisterSod("initstrings.js", "\u002f_layouts\u002f15\u002f1033\u002finitstrings.js?rev=uNmvBiHdrBzcPQzXRpm\u00252FnQ\u00253D\u00253D");</script>
    <script type="text/javascript">RegisterSod("strings.js", "\u002f_layouts\u002f15\u002f1033\u002fstrings.js?rev=DY9A0USYODVw86N0trJTSw\u00253D\u00253D");RegisterSodDep("strings.js", "initstrings.js");</script>
    <script type="text/javascript">RegisterSod("sp.init.js", "\u002f_layouts\u002f15\u002fsp.init.js?rev=QI1yUCfCoUkadL93jNZLOg\u00253D\u00253D");</script>
    <script type="text/javascript">RegisterSod("sp.res.resx", "\u002f_layouts\u002f15\u002fScriptResx.ashx?culture=en\u00252Dus\u0026name=SP\u00252ERes\u0026rev=yNk\u00252FhRzgBn40LJVP\u00252BqfgdQ\u00253D\u00253D");</script>
    <script type="text/javascript">RegisterSod("sp.ui.dialog.js", "\u002f_layouts\u002f15\u002fsp.ui.dialog.js?rev=0xf6wCIW4E1pN83I9nSIJQ\u00253D\u00253D");RegisterSodDep("sp.ui.dialog.js", "sp.init.js");RegisterSodDep("sp.ui.dialog.js", "sp.res.resx");</script>
    <script type="text/javascript">RegisterSod("core.js", "\u002f_layouts\u002f15\u002fcore.js?rev=ZvHGYvPbR2jV\u00252B4xx2UhUzQ\u00253D\u00253D");RegisterSodDep("core.js", "strings.js");</script>
    <meta name="Robots" content="NOINDEX " />
    <meta name="SharePointError" content="1" />
    <link rel="shortcut icon" href="/_layouts/15/images/favicon.ico?rev=23" type="image/vnd.microsoft.icon" /></head>
    <body id="ms-error-body" onload="if (typeof(_spBodyOnLoadWrapper) != 'undefined') _spBodyOnLoadWrapper();">
    <form method="post" action="usersettingserror.aspx?source=http%3a%2f%2friskpoints.nomura.com%2fsites%2frpg%2fWebResources%2fMay28%2fTestTree.aspx&amp;loginName=i%3a0%23.w%7ceurope%5cdasgupsa" id="aspnetForm" onsubmit="if (typeof(_spFormOnSubmitWrapper) != &#39;undefined&#39;) {return _spFormOnSubmitWrapper();} else {return true;}">
    <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTEzODY5NzkzMDQPZBYCZg9kFgICAQ9kFgICAw9kFgICCQ9kFgICAQ9kFgICAQ9kFgQCAQ8PFgIeC05hdmlnYXRlVXJsBeQBaHR0cDovL215c2l0ZXNzLm5vbXVyYS5jb206ODAvX2xheW91dHMvMTUvRWRpdFByb2ZpbGUuYXNweD9Vc2VyU2V0dGluZ3NQcm92aWRlcj0yMzRiZjBlZCUyRDcwZGIlMkQ0MTU4JTJEYTMzMiUyRDRkZmQ2ODNiNDE0OCZSZXR1cm5Vcmw9aHR0cCUzQSUyRiUyRnJpc2twb2ludHMlMkVub211cmElMkVjb20lMkZzaXRlcyUyRnJwZyUyRldlYlJlc291cmNlcyUyRk1heTI4JTJGVGVzdFRyZWUlMkVhc3B4ZGQCAw8PFgIfAAWPAWphdmFzY3JpcHQ6T25QcmV2aW91c1BhZ2VDbGlja2VkKCJodHRwOlx1MDAyZlx1MDAyZnJpc2twb2ludHMubm9tdXJhLmNvbVx1MDAyZnNpdGVzXHUwMDJmcnBnXHUwMDJmV2ViUmVzb3VyY2VzXHUwMDJmTWF5MjhcdTAwMmZUZXN0VHJlZS5hc3B4Iik7ZGRk/8DhVeqMpCBkDLwMGbJHyjvtFVboldzRyN3N1oU7pws=" />
    <script type="text/javascript">
    //<![CDATA[
    var g_presenceEnabled = true;
    var g_wsaEnabled = false;
    var g_wsaQoSEnabled = false;
    var g_wsaQoSDataPoints = [];
    var g_wsaLCID = 1033;
    var g_wsaListTemplateId = null;
    var g_wsaSiteTemplateId = 'STS#0';
    var _fV4UI=true;var _spPageContextInfo = {webServerRelativeUrl: "\u002fsites\u002frpg", webAbsoluteUrl: "http:\u002f\u002friskpoints.nomura.com\u002fsites\u002frpg", siteAbsoluteUrl: "http:\u002f\u002friskpoints.nomura.com\u002fsites\u002frpg", serverRequestPath: "\u002f_layouts\u002f15\u002fusersettingserror.aspx", layoutsUrl: "_layouts\u002f15", webTitle: "Global Risk Programmes Group", webTemplate: "1", tenantAppVersion: "0", webLogoUrl: "_layouts\u002f15\u002fimages\u002fsiteicon.png", webLanguage: 1033, currentLanguage: 1033, currentUICultureName: "en-US", currentCultureName: "en-GB", clientServerTimeDelta: new Date("2014-06-02T09:22:36.9098601Z") - new Date(), siteClientTag: "12$$15.0.4551.1001", crossDomainPhotosEnabled:false, webUIVersion:15, webPermMasks:{High:2147483647,Low:4294967295}, pagePersonalizationScope:1,userId:10, systemUserKey:"i:0\u0029.w|s-1-5-21-477418155-1331950027-3872095834-234225", alertsEnabled:true, siteServerRelativeUrl: "\u002fsites\u002frpg", allowSilverlightPrompt:'True',"themedCssFolderUrl" : "/sites/rpg/_catalogs/theme/Themed/37D18848","themedImageFileNames" : {"spcommon.png" : "spcommon-B35BB0A9.themedpng?ctag=6","ellipsis.11x11x32.png" : "ellipsis.11x11x32-2F01F47D.themedpng?ctag=6","O365BrandSuite.95x30x32.png" : "O365BrandSuite.95x30x32-C212E2FD.themedpng?ctag=6","socialcommon.png" : "socialcommon-6F3394A9.themedpng?ctag=6","spnav.png" : "spnav-230C537D.themedpng?ctag=6"}};function OnPreviousPageClicked(sourceUrl)
    document.cookie = "WSS_IgnoreUserSettingsOutOfSync=1; path=/";
    window.location = sourceUrl;
    }var MSOWebPartPageFormName = 'aspnetForm';//]]>
    </script>
    <script src="/_layouts/15/blank.js?rev=ZaOXZEobVwykPO9g8hq%2F8A%3D%3D" type="text/javascript"></script>
    <script type="text/javascript">
    //<![CDATA[
    if (typeof(DeferWebFormInitCallback) == 'function') DeferWebFormInitCallback();//]]>
    </script>
    <div id="ms-error-header" class="ms-pr">
    <h1 class="ms-core-pageTitle">
    </h1>
    <div>
    </div>
    </div>
    <div id="ms-error">
    <div id="ms-error-top">
    </div>
    <div id="ms-error-content">
    <div id="ms-error-error-content">
    <div id="DeltaPlaceHolderMain">
    <div>
    <span>
    <div id="ctl00_PlaceHolderMain_PanelSettingsOrReturnLink">
    <a id="ctl00_PlaceHolderMain_HLinkSettingsEditorPage" class="ms-descriptiontext" href="http://mysitess.nomura.com:80/_layouts/15/EditProfile.aspx?UserSettingsProvider=234bf0ed%2D70db%2D4158%2Da332%2D4dfd683b4148&amp;ReturnUrl=http%3A%2F%2Friskpoints%2Enomura%2Ecom%2Fsites%2Frpg%2FWebResources%2FMay28%2FTestTree%2Easpx">Edit user settings</a>
    <br/>
    <a id="ctl00_PlaceHolderMain_HLinkSettingsPreviousPage" class="ms-descriptiontext" href="javascript:OnPreviousPageClicked(&quot;http:\u002f\u002friskpoints.nomura.com\u002fsites\u002frpg\u002fWebResources\u002fMay28\u002fTestTree.aspx&quot;);">Return to original page.</a>
    </div>
    </span>
    </div>
    </div>
    </div>
    <div id="ms-error-gobackcont" class="ms-calloutLink">
    <a href="/sites/rpg" class='ms-calloutLink' id="ctl00_PlaceHolderGoBackLink_idSimpleGoBackToHome">Go back to site</a>
    </div>
    </div>
    </div>
    <script type="text/javascript">
    //<![CDATA[
    var _fV4UI = true;var g_MinimalDownload = true;var g_WebServerRelativeUrl = "/sites/rpg";var _spFullDownloadList = ['closeconnection', 'download', 'signout', 'xlviewer', 'wordviewer', 'wordeditor', 'powerpoint', 'powerpointframe', 'onenote', 'visiowebaccess', 'storefront', 'wopiframe', 'appredirect', 'wfstart'];
    //]]>
    </script>
    </form>
    </body>
    </html>
    Any help is appreciated. 
    thanks,
    Saurabh

    Hi,
    Would you mind providing the original version of your custom .aspx page? Can you just copy the content while open in SharePoint Designer and paste in a notepad?
    Thanks
    Patrick Liang
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Patrick Liang
    TechNet Community Support

  • Replace content smart objects doesnt work properly.

    Hello fellow Photoshoppers,
    Currently i am working on reusable album templates with smart objects. At first i was very enthusiastic but this was soon to end. as the replacing doesnt work properly.
    I made the smart object by using:
    1. > file
    2. > place
    then i try to replace the content by using.
    1. > layer
    2. > smart objects
    3. > replace contents
    the old image should get replaced by the chosen file and matching size, smart layers etc. However when i perform the same actions my image gets replaced but it is not the same size as the smart object it replaced. This makes the entire template useless as it would take far too much time resizing every single image. inspired by another video I also tried double clicking the layer and tried replacing the image in the editing sceen by dragging another file on top of the smart object. Again, it does not spread out to the full smart object size and i'm stuck with a small image in need of extra work.
    Needless to say, very frustrating.
    Any thoughts?

    Are you sure you understood how it is intended work?
    That is an interesting question, i have no experience with photoshop as i bought CS5,5 just a week ago and have no experience with any of the previous versions either. All info regarding how to make such a template i found from various tutorials, i posted one below. When they do it the image get scaled perfectly. Now since they use some smart filters in the tutorial i applied them aswell to see if this would fix the problem but it did not.
    http://www.picturesocial.com/video/wedding-photo-album-templates
    Are the images you want to switch in at least always of the same width to height-relation?
    I checked both files for consistency and discovered they were shot on different camera's. One file ( the origional smart object ) was cropped form a 21,0MP file and the other was croped from a 10,1 MP file. Both images were cropped to a 2x1 ratio. Having discovered the difference in pixel amount i cropped a different 21,0 MP file to 2x1 ratio and checked both files for their exact dimensions (both images are equal in size with 5616 x 2808 pixels) and replaced the content with the newly cropped file which gave a much better result. However, the image was slightly smaller in photoshop leaving a small gap where the origionally placed smart object lined up perfectly. I turned the situation around and placed the 10,1MP cropped image as the smart object and replaced the content by a 21,0 MP cropped image. As to be expected i ended up with a new image much larger then the smart object. So the smart object does not constrain the files to the dimensions set. As it turns out it only scales the replaced content relative to the size of the origional content of the smart object.
    I just need a reusable template with objects that:
    - cannot be moved once locked ( if possible) but can have its content replaced
    - scales the replaced content to the predefined dimensions
    - needs no prework like cropping to the same aspect ratio as the smart object content. ( i want to be able to place a landscape sized raw (3x2) on any landscape format  (2x1 / 16x9 / 4x3 or whatever) i find it acceptable to having to crop a portret to landscape orientation first before being able to replace a landscape.
    now ive been searching for more info and some people say indesign is much faster in making album pages so I am installing the program as we speak hoping this will be the solution.

  • Incoming email replaces content with contents from old email already in inb

    This morning for no apparent reason, incoming email has its content replaced with the entire content from seemingly random emails received months ago. It also replies the sender email to that attached to the old content.
    What could be happening here?

    Hello, and welcome to the Discussions.
    This is an indexing problem. Are you using any plugins or add on software for Mail? Any anti-virus or internet software, or backup software that is not Apple?
    If only noticed in the Inbox, then open the Inbox (for one account only, if more than one account is setup), click on Mailbox in the Menubar, and choose Rebuild. Rebuild repairs the universal index that Mail uses, but be aware that at one point in its operation, all message will disappear from the list of messages before all reappear. It can take several minutes if there are lots of messages.
    Is this account POP or IMAP, btw? I ask this because you should not use the method Mulder recommended if using an IMAP account, without additional steps.
    Ernie
    Message was edited by: Ernie Stamper

  • Scripting problem replacing layer contents.

    This is a follow up to the discussion in this thread http://forums.adobe.com/thread/480444?tstart=0.
    I've virtually completed the script, I attached it as a .txt file rather than .jsx , In a brief nutshell it does the following:
    Gets a text file name.
    opens the psd identified in that document
    walks the layers in that file
         if the layer is a text file and there is replacement text for that name in the input file, replace the text
         if the layer is an image (NORMAL) and there is an input file with a name (.jpg or .psd) matching the layer name then
               the layer is turned into a smart object and it's contents replaced with the contents of the relevant file.
    Saves the modified psd file as the name indicated in the input file and close the original file.
    If the input file indicates the file should be left open, reopen the modified file name.
    Almost everything works well except ...
    1. Sometimes the modified file loses it's layering and winds up with only a "background" layer whereas other times it retains it's layering. I'm sure this is due to some characteristic of the input template .psd, but with limited understanding of photoshop itself I've no idea what characteristic to look for.
    Any suggestions as to what might be the source of this problem?
    2. It appears that sometimes when creating the 1 layer file that will replace an image layer as a .jpg it losses the background transparency. This doesn't seem to happen if saved as a .psd, but the user wants to work with jpgs.
    Any ideas why?
    3. When replacing an image layer from another replacement file, the resulting new image in the modified file doesn't seem to be properly aligned. Incidentally, the same behaviour occurs if I do the steps of creating a smart layer and replacing manually in photoshop. I tried to attached the .psd files but the forum would not allow it.
    Again any ideas why it might be misaligned or a code change that will fix it?
    Any suggestions would be most thankfully accepted.
    Steve Ellis.

    3. When replacing an image layer from another replacement file, the resulting new image in the modified file doesn't seem to be properly aligned. Incidentally, the same behaviour occurs if I do the steps of creating a smart layer and replacing manually in photoshop. I tried to attached the .psd files but the forum would not allow it.
    Again any ideas why it might be misaligned or a code change that will fix it
    When a file is placed, you set the size and position in the layer. When you replace the contents the same transform values are used. If the file used to replace is not the same size as the first, it will not be the same size and location in the layer. I don't know of any way to determine the transform or reset it. The script could resize but that would require opening the file, resizing, and saving before the replace.
    I created the .psd file with which to replace the image layer from the image layer of the original by changing the image and saving it. I then checked the image size, canvas size, and transform values of both and they matched. When I ran the program the replaced image was misplaced, too high in the new psd. I then editing the replacing file and changing the y transform value until it resulted in the right place when placed by the script. For it to work properly the y transform value of the replacing layer was approximately 100 more than the replaced layer (I assume this particular value will vary with the particulars of the files). This is what confuses me, when they were identical it didn't work properly.

  • Find text and replace with a pdf stored in the same folder

    Hello,
    I have a catalog that is updated every so often.  I have written a script to find/replace the text from a .txt file.  but i have a pdf that i want to insert that is part of it as well.  Inside the .txt file i have the name of the document.  and the pdf is stored inside the same folder as the original .indd and the .txt file.
    can someone point me at some examples on how this could be done. 
    Thanks

    I use this script: it puts a txt in a text frame, check the overflow and find/replace some words with a pdf. Hope this is helpful.
    Paolo
    /************************FLOW************************************************
    * This function looks for Overflows in the story and either resizes the           *
    * frame to the size of the margins (if necesary) or adds a new page and     *
    * a new frame, which is then linked to the previous frame.esizes the           *
    function flow(){
        for(var i = 0; i < app.activeDocument.pages.count(); i++)
            for(var b = 0; b < app.activeDocument.pages[i].textFrames.count(); b++)
                if(app.activeDocument.pages[i].textFrames[b].overflows == true )
                    var currentPage = myDocument.pages[i];
                    var myPageNo = currentPage.name;
                    var currentFrame=currentPage.textFrames[b];
                    var e =currentFrame.geometricBounds[0];
                    var f =currentFrame.geometricBounds[1];
                    var g =currentFrame.geometricBounds[2];
                    var h =currentFrame.geometricBounds[3];
                    if(myPageNo %2==0){
                        var myMargins =currentPage.marginPreferences;
                        var a = currentPage.bounds[0]+myMargins.top;
                        var b = currentPage.bounds[1]+myMargins.right;
                        var c = currentPage.bounds[2]-myMargins.bottom;
                        var d = currentPage.bounds[3]-myMargins.left;
                    else{
                        var myMargins =currentPage.marginPreferences;
                        var a = currentPage.bounds[0]+myMargins.top;
                        var b = currentPage.bounds[1]+myMargins.left;
                        var c = currentPage.bounds[2]-myMargins.bottom;
                        var d = currentPage.bounds[3]-myMargins.right;
                    if (g < c)
                        currentFrame.geometricBounds = [a,b,c,d];
                    else if (g==c){
                    var newPage = myDocument.pages.add(LocationOptions.AFTER, currentPage);
                    currentPage = newPage;
                    myPageNo = currentPage.name;
                    if(myPageNo %2==0){
                        var myMargins =currentPage.marginPreferences;
                        var a = currentPage.bounds[0]+myMargins.top;
                        var b = currentPage.bounds[1]+myMargins.right;
                        var c = currentPage.bounds[2]-myMargins.bottom;
                        var d = currentPage.bounds[3]-myMargins.left;
                        var newFrame = currentPage.textFrames.add({geometricBounds:[a,b,c,d]});
                        newFrame.textFramePreferences.textColumnCount = 7;
                        newFrame.previousTextFrame = currentFrame;
                    else{
                        var myMargins =currentPage.marginPreferences;
                        var a = currentPage.bounds[0]+myMargins.top;
                        var b = currentPage.bounds[1]+myMargins.left;
                        var c = currentPage.bounds[2]-myMargins.bottom;
                        var d = currentPage.bounds[3]-myMargins.right;
                        var newFrame = currentPage.textFrames.add({geometricBounds:[a,b,c,d]});
                        newFrame.textFramePreferences.textColumnCount = 7;
                        newFrame.previousTextFrame = currentFrame;
    //************************************END FLOW FUNCTION*********************************************
    /*******************TextPlacer***************************
        this script will add a text file in an existing text frame
        Questo file deve essere copiato nella cartella Script di InDesign
    function myGetBounds(myDocument, myPage){
    var myPageWidth = myDocument.documentPreferences.pageWidth;
    var myPageHeight = myDocument.documentPreferences.pageHeight
    if(myPage.side == PageSideOptions.leftHand){
    var myX2 = myPage.marginPreferences.left;
    var myX1 = myPage.marginPreferences.right;
    else{
    var myX1 = myPage.marginPreferences.left;
    var myX2 = myPage.marginPreferences.right;
    var myY1 = myPage.marginPreferences.top;
    var myX2 = myPageWidth - myX2;
    var myY2 = myPageHeight - myPage.marginPreferences.bottom;
    return [myY1, myX1, myY2, myX2];
    /*******************ImagePlacer***************************
        this script will addimages to the document by
        substituting them with the name of the image file
        between @s (file format included[@mypic.bmp@]),
        selecting them from a specified file (see below)
        and applying object styles to them, as well as
        applying the right tab i necesary.
        It then looks for overflows in the document. If an
        overset is found, it will resize to margin size the
        text frame and if overset continues, it will add a
        new page and frame, which then will be linked
        to the previous frame, allowing the story flow.
        Questo file deve essere copiato nella cartella Script di InDesign
    //Creates a new document using the specified document preset.
    //Replace "myDocumentPreset" in the following line with the name
    //of the document preset you want to use.
    var myDocument = app.documents.add(true,app.documentPresets.item("Preset"));
    //If the active document has not been saved (ever), save it.
    if(app.activeDocument.saved == false){
    //If you do not provide a file name, InDesign displays the Save dialog box.
    app.activeDocument.save(new File("/Users/Paolo/Desktop/Documento.indd"));
    function main()
    var myDocument = app.documents.item(0);
    var myPage = myDocument.pages.item(0);
    var myTextFrame = myPage.textFrames.add({geometricBounds:myGetBounds(myDocument,myPage)});
    myTextFrame.textFramePreferences.textColumnCount = 7;
    myTextFrame.place(File("/Users/Paolo/Desktop/text.txt"));
    //Place a text file in the text frame.
    //Parameters for TextFrame.place():
    //File as File object,
    //[ShowingOptions as Boolean = False]
    //You'll have to fill in your own file path.
    //Define GREP search
    var grepFind ="@@@.+@@@";
    //Folders name where there are pdf, must be in the same place of the file
    var myFiguresFolder = "testatine";
    // Applied paragraph style
    var myPStyle = myDocument.paragraphStyles.item("Paragraphstyle");
    var NextPStyleCS = myDocument.paragraphStyles.item("Par_Style");
    var NextPStyleEN = myDocument.paragraphStyles.item("Par_Style_en");
    var NextPStyleDE = myDocument.paragraphStyles.item("Par_Style_de");
    // Applied text style
    var myCStyle = myDocument.characterStyles.item("text");
    //Applied object style
    var myOStyle = "";
    var oStyle_1 = myDocument.objectStyles.item("Pictures");
    var oStyle_2 = myDocument.objectStyles.item("Pictures");
    var oStyle_3 = myDocument.objectStyles.item("Pictures");
    //MEASUREMENTS
    var maxWidth = 467; //Maximum width of an image
    var maxHeight = 666; //Maximum Height of an image
    var colWidth = 468; //Width of the main columb (340pt) + maximum Tab (128pt)
    var maxTab = 0;
    var xTab;
    var xtTab;
    var minTWidth = 340; //any image with a width below this will have the maximum Tab (maxTab) applied.
    var PWidth; //Width of the Picture
    var PHeight;//Picture Height
    var myTotal;
    //---------------------------------ALERTS---------------------------------\\
    var notSaved = "Documento non salvato; devi prima salvare il documento";
    var noFolder = "No such folder exists; "+myFiguresFolder;
    var noImageMessage = "No Images were found";
    var finished = " immagini sostituite"
    //---------------------------------ALERTS---------------------------------\\
    /************************END OF STORY*****************************************
    *  The object of this bit of programming is to add an empty paragraph break *
    *  at the end of the story, in order to make the actual script work in the case   *
    *  that the LAST paragraph were a TABLE                                                              *
    var findEnd_of_Story = "\\r(?=\\z)" //GREP for End of Story                        //
    app.findGrepPreferences = NothingEnum.nothing;                              //
    app.changeGrepPreferences = NothingEnum.nothing;                         //
    app.findGrepPreferences.appliedParagraphStyle = myPStyle;              //
    app.findGrepPreferences.findWhat = findEnd_of_Story;                      //
    var fItems = myDocument.findGrep();                                              //
    var myC = fItems.length-1;                                                             //
    if (fItems =!0){                                                                              //
        do{                                                                                             //
            if (fItems.appliedParagraphStyle = myPStyle){                          //
                cItem = fItems[myC]                                                          //
                app.changeGrepPreferences.changeTo = "$0\\r";                  //
        myDocument.changeGrep();                                                       //
    myC--;                                                                                           //
    while (myC >= 0);                                                                       //
    try{
    var myDocPath = myDocument.filePath; //Complete Path to the Current Document
    catch (myError){
    alert (notSaved);
    //throw("");
    return;
    var myFFldr =Folder(myDocPath+"/"+myFiguresFolder); //Complete Path in which the figures to be placed should be found
    if(myFFldr.exists){
        flow();
        app.findGrepPreferences = app.changeGrepPreferences = null;
        app.findGrepPreferences.findWhat = grepFind;
        var myFoundItems = app.activeDocument.findGrep();
        var myCounter = myFoundItems.length-1
        myTotal = myCounter+1;
        for (i = myCounter; i >=0; i--) {
            var myName = myFoundItems[i].contents.replace (/@/g, "");
            app.selection = myFoundItems[i];
            var fFig=app.selection[0];//Found text for
            var cPStyle= fFig.appliedParagraphStyle;
            var myFile = new File( myFFldr + "/" + myName);
            if (myFile.exists) {
                var cFig = fFig.place(myFile);
                var sFig = cFig[0].parent;
              switch (cPStyle){
                  case (myPStyle):
                  myOStyle =oStyle_1;
                  PWidth = sFig.geometricBounds[3] - sFig.geometricBounds[1];
                  PHeight = sFig.geometricBounds[2] - sFig.geometricBounds[0];
                  if (PWidth >= minTWidth){
                      xTab = (colWidth-PWidth);
                  else{
                      xTab =maxTab;
                  var currentPar = sFig.parent.paragraphs.item(0);
                  currentPar.leftIndent = xTab;
                  var nextPar= currentPar.insertionPoints[-1].paragraphs[0];
                  var nextParStyle = nextPar.appliedParagraphStyle;
                  if (nextParStyle == NextPStyleCS||nextParStyle ==NextPStyleEN||nextParStyle == NextPStyleDE){
                      xtTab = xTab
                  else {
                      xtTab = nextPar.leftIndent;
                  nextPar.leftIndent =xtTab;
                  sFig.appliedObjectStyle = myOStyle;
                  cPStyle = "";
                  break;
                  case (myPStyle):
                  myOStyle = oStyle_3;
                  sFig.appliedObjectStyle = myOStyle;
                  cPStyle = "";
                  break;
                  default:
                  myOStyle = oStyle_2;
                  sFig.appliedObjectStyle = myOStyle;
                  cPStyle = "";
                  break;
              var oFig = sFig;
              sFig = ""
    flow();
      //alert(myTotal + finished);
    else{
        alert(noFolder);
    var myDocument = app.documents.item(0);
    //Clear the find/change grep preferences.
    app.findGrepPreferences = NothingEnum.nothing;
    app.changeGrepPreferences = NothingEnum.nothing;
    //Set the find options.
    app.findChangeGrepOptions.includeFootnotes = false;
    app.findChangeGrepOptions.includeHiddenLayers = false;
    app.findChangeGrepOptions.includeLockedLayersForFind = false;
    app.findChangeGrepOptions.includeLockedStoriesForFind = false;
    app.findChangeGrepOptions.includeMasterPages = false;
    //Regular expression to use
    app.findGrepPreferences.findWhat = "<(.+?)>";
    //Apply the change to 24-point text only.
    //app.findGrepPreferences.pointSize = 24;
    //app.changeGrepPreferences.underline = true;
        var myFoundItems = app.activeDocument.findGrep();
        var myCounter = myFoundItems.length-1
        myTotal = myCounter+1;
        //alert("occorrenze" + myTotal);
        app.changeGrepPreferences.changeTo= "$1";
        app.changeGrepPreferences.appliedCharacterStyle= myDocument.characterStyles.item("head");
       myDocument.changeGrep();
      for (i = myCounter; i >=0; i--) {
            var myName = myFoundItems[i].contents.replace ("/</g", "");
            var myName = myFoundItems[i].contents.replace ("/>/g", "");
            app.selection = myFoundItems[i];
            var fFig=app.selection[0];//Found text for
            var myCStyle = myDocument.characterStyles.item("head");
            app.selection[0].applyCharacterStyle(myCStyle, true);
    //Clear the find/change preferences after the search.
    app.findGrepPreferences = NothingEnum.nothing;
    app.changeGrepPreferences = NothingEnum.nothing;
    main();

  • How to replace a line ina text file using java?

    Hi ALL,
    Does anybody know how to replace a line in a text file uisng java.

    use this thing:
    http://doesthatevencompile.com/current-projects/code-sniplets/ASCIIFile.htm
    open the file,
    read its contents, replace the text you need in the contents, set the contents back into the file.
    it takes care of the IO for you.

  • How to place a WebPart in Publishing Page Content

    Hi,
    when you use a publishing page you are able through the ribbon to add existing webparts into the content of the publishing page.
    I would like to add programmatically a webpart into the content of the publishing page. I couldnt find anyting to that question on the web.
    Can someone help?
    regards
    yavuz
    Regards
    Yavuz
    www.ybog.net | Field notes on software development and technology

    Try below:
    http://sharepoint2010mind.blogspot.in/2012/06/add-webpart-programmatically-publishing.html
    http://sharepoint.stackexchange.com/questions/86026/add-programmatically-custom-web-part-to-page-without-web-part-zone
    PublishingWeb pWeb = PublishingWeb.GetPublishingWeb(web);
    string pageName = "NewPage.aspx";
    PageLayout[] pageLayouts = pWeb.GetAvailablePageLayouts();
    PageLayout newPage = pageLayouts[0]; //Body only type of page layout
    PublishingPageCollection pages = pWeb.GetPublishingPages();
    PublishingPage nPage = pages.Add(pageName, newPage);
    nPage.Update();using (SPSite site = new SPSite("http://win2008/sites/publishing"))
    SPWeb web = site.RootWeb;
    SPFile page = web.GetFile("Pages/Lipsum.aspx");
    page.CheckOut();
    using (SPLimitedWebPartManager wpmgr = page.GetLimitedWebPartManager(PersonalizationScope.Shared))
    Guid storageKey = Guid.NewGuid();
    string wpId = String.Format("g_{0}", storageKey.ToString().Replace('-', '_'));
    XmlElement p = new XmlDocument().CreateElement("p");
    p.InnerText = "Hello World";
    ContentEditorWebPart cewp = new ContentEditorWebPart
    Content = p,
    ID = wpId
    wpmgr.AddWebPart(cewp, "wpz", 0);
    string marker = String.Format(CultureInfo.InvariantCulture, "<div class=\"ms-rtestate-read ms-rte-wpbox\" contentEditable=\"false\"><div class=\"ms-rtestate-read {0}\" id=\"div_{0}\"></div><div style='display:none' id=\"vid_{0}\"></div></div>", new object[] { storageKey.ToString("D") });
    SPListItem item = page.Item;
    string content = item["PublishingPageContent"] as string;
    item["PublishingPageContent"] = content.Replace("|", marker);
    item.Update();
    page.CheckIn(String.Empty);
    http://sharepoint.stackexchange.com/questions/86026/add-programmatically-custom-web-part-to-page-without-web-part-zone
    http://www.zeemanj.net/?p=291

  • Replace swatches and text?

    Is it possible (with javascript code) to do the following?
    1.  Prompt user to select a color from a predetermined set of colors (hard coded in the script) via a dropdown list
    2.   Take the value that the user selects, and replace the color of all  items that use the swatch called "Primary" with the user selected color  (which is already a swatch name in the document)
    3.  Find and  replace all text in the document from "Primary" to the text that the  user had previously selected from the drop down (it was also a swatch  name).
    4.  Prompt the user to select another color (secondary  color) from a predetermined set of colors (hard coded in the script) via  a dropdown list
    5.  Again, take the value that the user selects  here and replace the color of all items that use the swatch called  "Secondary" to the user selected swatch name.
    6.  Find and replace  all text in the document from "Secondary" to the text  that the user  had previously selected from the drop down (it was also a  swatch name).
    7.  Remove all unused swatches.
    Steps 1 & 4 could be combined, if Javascript allows...but I don't know if it does or not.
    Let me know if you think this is possible please.
    Thanks!

    In my made-up test document this worked but Im not sure what mileage you will get… Worth a test anyhows…
    #target illustrator
    // Global Variables
    var aSel,bSel
    // Main Window Dialog
    function csDialog() {
         var fabGroup = app.activeDocument.swatchGroups.getByName('Fabrics');
         var allFabs = fabGroup.getAllSwatches();
         var fabNames = Array();
         for (var i = 0; i < allFabs.length; i++) {
              fabNames.push(allFabs[i].name);
              if (i < allFabs.length-1) fabNames.push('-');
         var csdlg = new Window('dialog', 'Tim\'s Fabric Picker…',[0,0,300,205]);
         // Panel 1
         csdlg.Pnl = csdlg.add('panel', [15,15,285,72], 'Pick your "Primary" fabric swap:');
         csdlg.Pnl.cs1 = csdlg.Pnl.add('dropdownlist', [15,20,255,37], fabNames);
         // Panel 2
         csdlg.Pn2 = csdlg.add('panel', [15,92,285,149], 'Pick your "Secondary" fabric swap:');
         csdlg.Pn2.cs3 = csdlg.Pn2.add('dropdownlist', [15,20,255,37], fabNames);
         // Standard Buttons     
         csdlg.cancelBtn = csdlg.add('button', [15,164,125,186], 'Cancel', {name:'cancel'});
         csdlg.okBtn = csdlg.add('button', [175,164,285,186], 'OK', {name:'ok'});
         // Panel 1 call backs
         csdlg.Pnl.cs1.onChange = function() {
              aSel = csdlg.Pnl.cs1.items[parseInt(this.selection)];
         // Panel 2 call back
         csdlg.Pn2.cs3.onChange = function() {
              bSel = csdlg.Pn2.cs3.items[parseInt(this.selection)];
         // Button call back
         csdlg.okBtn.onClick = function() {
              csdlg.close(1);
              colourSwapper(aSel,bSel); // Here call the process
         csdlg.center();
         csdlg.show();
    // Main active document commands go here
    function colourSwapper(a,b) {
         var uIL = app.userInteractionLevel;
         app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
         var docRef = app.activeDocument;
         recurseLayers(docRef.layers);
         alert('Now run Action:\r"Delete Unused Panel Items"');
         app.userInteractionLevel = uIL;
    // Main active document check function
    function activeDoc() {
         if (app.documents.length == 0) {
              alert('NO document open?');
              return;
         } else {
              csDialog();
    activeDoc();
    function recurseLayers(objArray) {
         for (var i = 0; i < objArray.length; i++) {
              var l = objArray[i].locked;
              if (l) objArray[i].locked = false;
              var v = objArray[i].visible;
              if (!v) objArray[i].visible = true;
              changeText(objArray[i].textFrames);
              changeColours(objArray[i].pathItems);
              if (objArray[i].layers.length > 0) {
                   recurseLayers(objArray[i].layers)
              if (objArray[i].groupItems.length > 0) {
                   recurseGroups(objArray[i].groupItems)
              if (objArray[i].compoundPathItems.length > 0) {
                   loopCompounds(objArray[i].compoundPathItems)
              objArray[i].locked = l;
              objArray[i].visible = v;
    function recurseGroups(objArray) {
         for (var i = 0; i < objArray.length; i++) {
              var l = objArray[i].locked;
              if (l) objArray[i].locked = false;
              var h = objArray[i].hidden;
              if (h) objArray[i].hidden = false;
              changeText(objArray[i].textFrames);
              changeColours(objArray[i].pathItems);
              if (objArray[i].groupItems.length > 0) {
                   recurseGroups(objArray[i].groupItems)
              if (objArray[i].compoundPathItems.length > 0) {
                   loopCompounds(objArray[i].compoundPathItems)
              objArray[i].locked = l;
              objArray[i].hidden = h;
    function loopCompounds(objArray) {
         for (var i = 0; i < objArray.length; i++) {
              var l = objArray[i].locked;
              if (l) objArray[i].locked = false;
              var h = objArray[i].hidden;
              if (h) objArray[i].hidden = false;
              changeColours(objArray[i].pathItems);     
              objArray[i].locked = l;
              objArray[i].hidden = h;
    function changeColours(objArray) {
         for (var i = objArray.length-1; i >= 0; i--) {
              var l = objArray[i].locked;
              if (l) objArray[i].locked = false;
              var h = objArray[i].hidden;
              if (h) objArray[i].hidden = false;
              if (objArray[i].fillColor instanceof SpotColor) {
                   if (objArray[i].fillColor.spot.name == 'Primary') {
                        objArray[i].fillColor = app.activeDocument.swatches.getByName(aSel).color;
                   if (objArray[i].fillColor.spot.name == 'Secondary') {
                        objArray[i].fillColor = app.activeDocument.swatches.getByName(bSel).color;
              objArray[i].locked = l;
              objArray[i].hidden = h;
    function changeText(objArray) {
         for (var i = objArray.length-1; i >= 0; i--) {
              var l = objArray[i].locked;
              if (l) objArray[i].locked = false;
              var h = objArray[i].hidden;
              if (h) objArray[i].hidden = false;
              if (/Primary/.test(objArray[i].contents)) {
                   objArray[i].contents = objArray[i].contents.replace('Primary', aSel)
              if (/Secondary/.test(objArray[i].contents)) {
                   objArray[i].contents = objArray[i].contents.replace('Secondary', bSel)
              objArray[i].locked = l;
              objArray[i].hidden = h;
    I left quite a bit of stuff that deals with hidden and locked items… If you don't require this it can be easily stripped out…

  • Find and replace month names

    Dear all, I have a few eps files in which month-year format is written like May-12, June-13 etc. I want to change May to Mai, June to Juin etc.
    Virender
    var myDoc = app.activeDocument;
    for (i = 0; i < myDoc.textFrames.length; i++ )
         var textArt = myDoc.textFrames[i];
         for (j =0; j < textArt.words.length; j++ )
          var word = textArt.words[j];
         switch (word.contents)
         case "May-\d\d":    // please advise here
                word.contents = "Mai";
            break;
         case "Mar-\d\d":
                word.contents = "Mrz";
            break;
         case "June-\d\d":
                word.contents = "Juin";
            break;
    alert("Done");

    Vielen Dank pixxxel schubser.
    I worte below script as per your suggustion and my requirements. Meanwhile this scipt convert English month to german months. Any possibility I can create a script which ask me for German, French and Italy buttons. So if I click on German button, then German's month coding execute and if i click on French then French's month coding execute and so on. I knew it can be done using dialog (in Indesign I sure) but not sure in Illustrator. Kindly advise.
    var myDoc = app.activeDocument;
    for (i = 0; i < myDoc.textFrames.length; i++ )
         var textArt = myDoc.textFrames[i];
         for (j =0; j < textArt.words.length; j++ )
          var word = textArt.words[j];
            word.contents = word.contents.replace ("Mar", "Maz");
            word.contents = word.contents.replace ("May", "Mai");
            word.contents = word.contents.replace ("Oct", "Okt");
            word.contents = word.contents.replace ("Dec", "Dez");
    //alert("Done");

  • Business Content for SRM 5.0 in SP9

    Hi All,
    We have BI_CONT release 702 with Level 0005. But when I try to install the transformations or any new objects like DTP, I'm not able to find many of those in Business Contents. Are these objects not yet delivered with the standard content? Do anyone have any official information on this or any OSS Note? Any planned release dates?
    Also any information on existing contnts for SRM 5.0
    Thanks in advance
    Amit

    Hi,
    But i know from the documentation of SRM 5.0 --> master Guide --->   It has been mentioned as follows
    1) THE SRM 5.0 CONFIGURATION DOCUMENTATION IS DELIVERED WITH THE  ST-ICO  150 CONTENT SHIPMENT FOR SOLUTION MANAGER
    2) SOLUTION MANAGER CONTENT REPLACES THE BUSINESS SCENARIO CONFIGURATION GUIDES , WHICH WERE DELIVERED WITH EARLIER SRM SHIPMENTS
    3) THE USE OF SOLUTION MANAGER IS MANDATORY FOR MYSAP SRM 5.0
    4) if you have a look at the Master guide for SRM 5.0 ---> there is one seperate section  available --->
    1.2 Solution Manager ---> which gives more details of the solution manager and its content.
    Edited by: khan voyalpad usman on Feb 12, 2008 7:49 PM

  • Installation of BI Content SP09

    Hi SAP BI experts,
    we are running SAP BI 7.0 with BI Content AddOn 3 Patch Level 0. In order to resolve some problems with queries on virtual InfoCube 0FIGL_V10 we want to install Support Package 9 for BI Content (see also SAP Note 1121942). Unfortunately  we haven't found any documentation on the installation of BI Content support packages. It would be great if anyone could give me some answers to my questions:
    Is patching the BI Content the one and only solution to our problem with the queries on 0FIGL_V10?
    If not, is there an easier way to get the problem solved?
    How do I install the Support Package 9 BI Content Patch?
    Do I have to install all previous support packages for sp9 to work (we are at AddOn 3 PatchLevel 000)?
    What are known problems/side effects of BI Content patching?
    Are the InfoObjects, InfoProvider etc. activated from BI Content replaced in the A-version or simply in D-version?
    Do I have to patch the BI Content in our source system SAP ECC 6.0 IDES as well?
    Thank you very much in advance
    Martin

    Dear ,
    you are doing almost Correct way only; but the thing when you are installing BI  Content objects please check whether the same active or not, if not go for install the object and use it for your work.
    Regards
    sree

  • Content not fading with containing element

    I am using the update content feature of spry in conjunction
    with a spry fade in/out effect which works very well aside from in
    a couple of instances. Firstly, I have a div that has its content
    replaced, before it is replaced it fades out, but the .swf file
    inside the content does not fade out with the rest of the content.
    Secondly I have the same issue with the spry tabbed panels.
    The rest of the content fades in or out fine but the tabs
    themselves do not.
    In both cases either the tabs or the .swf file stay at 100%
    opacity until the rest of the content has been replaced.
    Any help would be be greatly appreciated.

    quote:
    Originally posted by:
    kinblas
    The flash problem is due to the fact that the flash plugin
    uses a native window by default ... this window is on top of the
    browser's canvas where your page is drawn. To get it to fade with
    the rest of the content, you're going to have to tell Flash to draw
    into the same window that contains the browser canvas. Follow the
    instructions here:
    http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_15523
    I'd have to see your code that is fading your tabbed panels
    as well as your tabbed panel markup ... got url? ... are you fading
    the top-level element of the entire tabbed panel widget? Or are you
    fading just the panel content?
    --== Kin ==--
    No URL at present Im afraid as its currently on an internal
    only server. However its pretty easy to understand. There is a
    single div containing the tabbed panel set, it is this outer div
    that I am calling new content in to and fading out the old, so yes,
    its fading the outer most div that contains the tabbed panel set.
    This is the link that is clicked for example:
    <a href="#" class="menu"
    onclick="fade_content('content','../../v_content/v_products/lan.htm');
    return false;">Wireless LAN</a>
    This is the script that is used:
    function fade_content(ele,url){
    Spry.Effect.DoFade('content',{ duration: 500, from: 100, to:
    0, finish: function() {
    Spry.Utils.updateContent(ele, url, function() {
    Spry.Effect.DoFade('content',{ duration: 500, from: 0, to:
    100 });
    This is the Div that is being replaced/faded:
    <div id="content">
    <script type="text/javascript">
    <!--
    Spry.Utils.updateContent('content','../../v_content/v_company/about_qolcom.htm');
    //-->
    </script>
    </div>
    and finally an example of the content that is being called in
    to the content div would be something like this:
    <table width="100%" border="0" cellspacing="0"
    cellpadding="0" class="table_no_format" height="332">
    <tr>
    <td valign="top" align="left">
    <h2>Contact QoLcom</h2>
    <div id="TabbedPanels1" class="TabbedPanels">
    <ul class="TabbedPanelsTabGroup">
    <li class="TabbedPanelsTab" tabindex="0">Head
    Office</li>
    <li class="TabbedPanelsTab" tabindex="0">Stirling
    Office</li>
    <li class="TabbedPanelsTab" tabindex="0">Support
    Team</li>
    <li class="TabbedPanelsTab" tabindex="0">Invoice
    &amp; Payments</li>
    <li class="TabbedPanelsTab" tabindex="0">Registered
    Office</li>
    </ul>
    <div class="TabbedPanelsContentGroup">
    <div class="TabbedPanelsContent">
    <h2>Head Office</h2>
    QoLcom Limited
    <br />
    Unit 3 King John House
    <br />
    Kingsclere Park
    <br />
    Kingsclere
    <br />
    Newbury
    <br />
    Berkshire
    <br />
    RG20 4SW
    <br />
    United Kingdom
    <br />
    <br />
    T: +44 (0)870 2503000
    <br />
    <br />
    F: +44 (0)870 2503001
    <br />
    <br />
    E: <a
    href="mailto:[email protected]">[email protected]</a>
    <br />
        <a
    href="mailto:[email protected]">[email protected]</a>
    <br />
        <a
    href="mailto:[email protected]">[email protected]</a>
    <br />
        <a
    href="mailto:[email protected]">[email protected]</a>
    </div>
    <div class="TabbedPanelsContent">
    <h2>Stirling Office</h2>
    QoLcom Limited
    <br />
    Springfield House
    <br />
    Laurelhill Business Park
    <br />
    Stirling
    <br />
    FK7 9JQ
    <br />
    Scotland
    <br />
    <br />
    T: +44 (0)870 2503000
    <br />
    <br />
    F: +44 (0)1786 406351
    </div>
    <div class="TabbedPanelsContent">
    <h2>Support Team</h2>
    If you need to contact our Support Team please submit a
    support request to <a
    href="mailto:[email protected]">[email protected]</a>
    <br />
    <br />
    Alternatively, you can telephone the support team on
    +44(0)870 2503000 between 9.00am and 5.30pm Monday to Friday.
    </div>
    <div class="TabbedPanelsContent">
    <h2>Invoice &amp; Payments</h2>
    QoLcom Limited
    <br />
    Unit 3 King John House
    <br />
    Kingsclere Park
    <br />
    Kingsclere
    <br />
    Newbury
    <br />
    Berkshire
    <br />
    RG20 4SW
    <br />
    United Kingdom
    <br />
    <br />
    T: +44 (0)870 2503000
    <br />
    <br />
    F: +44 (0)870 2503001
    <br />
    <br />
    E: <a
    href="mailto:[email protected]">[email protected]</a>
    </div>
    <div class="TabbedPanelsContent">
    <h2>Registered Office</h2>
    QoLcom Limited
    <br />
    c/o Dove, Marsh &amp; Jones
    <br />
    1 Andromeda House
    <br />
    Calleva Park
    <br />
    Aldermaston
    <br />
    Reading
    <br />
    Berkshire
    <br />
    RG7 8AP
    <br />
    United Kingdom
    <br />
    <br />
    <strong>Note:</strong> These are our
    accountant’s offices. Only use this address for the purposes
    of sending legal notices.
    <br />
    <br />
    Our operational company address can be found on the Head
    Office tab of this page.
    </div>
    </div>
    </div>
    </td>
    </tr>
    </table>
    <script type="text/javascript">
    <!--
    var TabbedPanels1 = new
    Spry.Widget.TabbedPanels("TabbedPanels1");
    //-->
    </script>
    CSS is pretty much untouched and the js file hasnt been
    changed.
    TIA

  • Powershell replace text in multiple files lookup CSV

    Hiya guys
    After some guidance please.
    I have a CSV with following details
    MailboxName, PRFNAME,TempConstant
    usera, a, usera.prf,TEMPLATEPRFUSER
    userb, b, userb.prf,TEMPLATEPRFUSER
    userc, c, userc.prf,TEMPLATEPRFUSER
    Im after creating multiple copies of a prf file with the PRFNAME
    Import-Csv $UsernamesCSV | % { Copy-Item "C:\TemplatePRF\Template.prf" "C:\TEST\$($_.NewPRFName)"}
    This creates multiple prfs named correctly based on the prfnames provided in the CSV
    Now I want to search for mailboxname=TEMPLATEPRFUSER and replace to "MailboxName" from my csv.
    so it will be
    usera.PRF
    ContentsMailboxname=user, a
    userb.prf
    contents
    mailboxname=user, b
    So the common field to replace will be TEMPALTEPRF but replace with the relevatnt mailboxname depending on prf name.
    After looking around I found the following
    Param (
    #$List = "C:\TemplatePRF\mailbox.csv",
    $Files = "c:\Test\*.prf"
    $ReplacementList = Import-Csv $UsernamesCSV;
    Get-ChildItem $Files |
    ForEach-Object {
    $Content = Get-Content -Path $_.FullName;
    foreach ($ReplacementItem in $ReplacementList)
    $Content = $Content.Replace($ReplacementItem.TEMPConstant, $ReplacementItem.mailboxn)
    Set-Content -Path $_.FullName -Value $Content
    At the moment all the files will then have the content "mailboxname=" set as user,a and it does not seem to loop through the remaining and replace correctly.

    It looks like something along these lines should work, though the CSV data you posted is currently invalid. If you want to have a comma in a field (such as user, a), it needs to be quoted. Otherwise the comma is treated as a delimiter in the CSV.  Generally,
    I would recommend just quoting everything, to avoid problems. That's what PowerShell does when you use Export-Csv. Here's the test file I used:
    "MailboxName","PRFNAME"
    "usera, a","usera.prf"
    "userb, b","userb.prf"
    "userc, c","userc.prf"
    I got rid of the TempConstant field; there's no reason to repeat that data on every line of the CSV file.  It's just hard-coded in the script right now.  Here's the code:
    $templateFile = 'C:\TemplatePRF\template.prf'
    $csvFile = 'C:\TemplatePRF\mailbox.csv'
    $outputDirectory = 'C:\TemplatePRF\New'
    if (-not (Test-Path -Path $outputDirectory -PathType Container))
    New-Item -Path $outputDirectory -ItemType Directory -ErrorAction Stop
    $templateContents = Get-Content -Path $templateFile -ErrorAction Stop
    Import-Csv -Path $csvFile |
    ForEach-Object {
    $record = $_
    $newContents = $templateContents -replace '(?<=mailboxname\s*=\s*)%TEMPLATEPRFUSER%', $record.MailboxName
    $newFile = Join-Path -Path $outputDirectory -ChildPath $record.PRFNAME
    Set-Content -Path $newFile -Value $newContents

Maybe you are looking for

  • WHERE Statement Help

    Hi, cant get to grips with this problem, need to select from dbo.booking_form all records that meet 2 statements. 1st allocated='completed' and 2nd account is not 'CASH' , ie all records that don't contain the word CASH in the field 'ACCOUNT' Below i

  • Really i need a help apple!

    I am jahir again, if you remember to send this message saying that my iphone 6 plus was wrong giving blue screen while using or red display for behold talk to the service apple ok were very friendly offered to send me a box for it resends and could h

  • I have lost "All" of my toolbars. How do I get them back?

    The only toolbar I have left on Firefox is the "Bookmarks Toolbar", how do I get the others back? And right-clicking does nothing. == This happened == Just once or twice == Today when mouse dropped on floor.

  • Adobe Standard 8.1.2 Opens but keeps closing

    I have adobe acrobat standard 8.1.2., when I open a pdf file, it opens like for 10 seconds and the program closes. How do I fix this?

  • What is faster Me.Filter or Me.RecordSource

    I created a form that Search As You Type. When you type in a combo box, Access displays matching records. I use the On Change event with a private Sub. To find the records you can use the Form Filter or Form RecordSource property with a Sql Where Cla