Need script for Marginal Elements consists two tags

Hi Everyone,
I need a script for the Marginal Elements having two Paragraph tags. Object Styles, Library items are all availale for this job. My requirement is cut the two paragraph tags and put it in library items and also using object styles as well. Is it possible? Can you help for this. For more clarification i have attached that file also.
Waiting for your reply....

Hi Try This code.....
main();
function main(){
    if (app.documents.length!=0){
        if(app.libraries.length!=0){
        myStyleDialog();
        else {
            alert ("Please open the Library.");
    else {
        alert ("Please open a document and try again.");
        exit(0);
function myStyleDialog(){
var myLabelWidth = 120;
var myParaStyleNames = myGetParagraphStyleNames();
//var myObjStyleNames = myGetObjectStyleNames();
var myDialog = app.dialogs.add({name:"Choose Styles to Place Anchor"});
with(myDialog.dialogColumns.add()){
    with(borderPanels.add()){
        with(dialogColumns.add()){
            with(dialogRows.add()){
                with(dialogColumns.add()){
                    staticTexts.add({staticLabel:"Choose Paragraph Style1:", minWidth:myLabelWidth});
                with(dialogColumns.add()){
                    myParaStyleDropdown1 = dropdowns.add({stringList:myParaStyleNames, selectedIndex:0});
              with(dialogRows.add()){
                    with(dialogColumns.add()){
                        staticTexts.add({staticLabel:"Choose Paragraph Style2:", minWidth:myLabelWidth});
                    with(dialogColumns.add()){
                        myParaStyleDropdown2 = dropdowns.add({stringList:myParaStyleNames, selectedIndex:0});
//~                     with(dialogRows.add()){
//~                         with(dialogColumns.add()){
//~                             staticTexts.add({staticLabel:"Object Styles:", minWidth:myLabelWidth});
//~                             }
//~                         with(dialogColumns.add()){
//~                             myObjectStyleDropdown = dropdowns.add({stringList:myObjStyleNames, selectedIndex:0});
//~                     }
//~         }
    myReturn = myDialog.show();
    if(myReturn == true){
         myParagraphStyle1 = myParaStyleNames[myParaStyleDropdown1.selectedIndex];
        myParagraphStyle2 = myParaStyleNames[myParaStyleDropdown2.selectedIndex];
        // myObjectStyle = myObjStyleNames[myObjectStyleDropdown.selectedIndex];
         myDialog.destroy();
      else {
      myDialog.destroy();
function myGetParagraphStyleNames(){
    var myStyleNames = app.documents.item(0).paragraphStyles.everyItem().name;
    return myStyleNames;
//~ function myGetObjectStyleNames(){
//~     var myObjStyleNames = app.documents.item(0).objectStyles.everyItem().name;
//~     return myObjStyleNames;
//~ }
var myDoc = app.activeDocument;
var myStory = myDoc.stories;
var myParas, myCount = 0;
var myLib = app.libraries[0];
var AnchorItemName = prompt("Enter the Library Item Name Exactly","","Anchor Item");
for(i=0; i<myStory.length; i++)
    myParas = myStory[i].paragraphs;
    if (myParas.length>3)
        for(j=0; j<myParas.length-1; j++)
            var firstPara = myParas[j];
            var nextPara = myParas[j+1];
            var firstParaStyle = firstPara.appliedParagraphStyle.name;
            var nextParaStyle = nextPara.appliedParagraphStyle.name;
            if ((nextParaStyle == myParagraphStyle2)&&(firstParaStyle == myParagraphStyle1))
                myText = myLib.assets.item (AnchorItemName).placeAsset (firstPara.insertionPoints[0])[0];
                firstPara.move(LocationOptions.after, myText.insertionPoints[0]);
                nextPara.move(LocationOptions.after, myText.insertionPoints[-1]);
                myText.fit(FitOptions.frameToContent);
                myCount++;
                }//End if
        }//End of Para iteration
    }//End of If paralength>2
    }//End of story iteration
alert(myCount + " Ocurrences Found and Processed");
Green4ever

Similar Messages

  • Need script for moving files to specific directories base on csv

    Hi,
    I have a question. I have about 2000 files (pdf), which I need move to specific directories and subdirectories, which are based on csv file.
    Csv is looking like this:
    filename;directoryname;subdirectoryname;subdirectoryname;.......etc.
    I have a script for creating directories with subdirectories from csv file, but I need this script for moving files to this directories.....
    Thanks a lot for every help.
    Best Regards
    Petr, OS X Mavericks

    private function snapshotLastFrame():void
    gotoAndStop( this.totalFrames );
    _bitmapData                         = new BitmapData( stage.stageWidth, stage.stageHeight );
    _bitmap                              = new Bitmap( _bitmapData );
    _bitmapData.draw ( stage );
    saveImageJPG( _bitmapData, "test.jpg", 96 );
    public function saveImageJPG( bitmapData:BitmapData, fileName:String, quality:int ):void {
                this.jpgEncoder = new JPGEncoder( quality );
                this.fileReference = new FileReference();
                this.fileReference.save( this.jpgEncoder.encode( bitmapData ), fileName + ".jpg" );
    Keep in mind that you need a few extra libraries to be able to create a jpeg.. (AS3CoreLib) can be found at googleCode.

  • Need script for exporting images to EPS

    I need to write a script to export a whole bunch of files from Indesign CS3 to EPS files. Right now we do them one at a time...here are the steps we take that we would need included in the script...
    Select all (Control A), ungroup, convert to outlines (control-shift O), export (need to be able to say black or white or RGB) and then close the file without saving.
    and if there was anyway to loop this script for 20 files at a time that would be really helpful.
    Can any help or direct me to a website that can help.
    Thanks!
    Marissa

    Maybe this one: http://www.kahrel.plus.com/indesign/batch_convert_cs3.html
    Peter

  • Need Script for Videopodcast.

    Looking for Script  for iTunes, to extract audio segment from Vide podcast  and save it for iPod Nano. can' find it in dougscripts.com/iTunes. Used to have that script but lost due to update my OS 10 to 10.9.4 Thank you! Igor.

    Hasvi,
    You can use the method "convertBulletsAndNumberingToText ()"
    e.g. app.activeDocument.stories.everyItem().convertBulletsAndNumberingToText();
    It converts the bullets and numbering to text present in all the active document stories (Footnotes and Tables will be done separately).
    ~Green4ever

  • Need script for ID 5.5

    Not even sure if this can be done with a script. A client send me an ID book in version 5.5. She set up her margins so that there would be extra space at the spine, but she didn't bother to set up her master pages in a two page spread so that her margins would be mirrored. What we need to do is move everything on each recto page (each page has at least two text frames in columns, plus call-out boxes with a separate floating text frame inside, sometimes photos, sometimes headings, all in separate frames) a quarter of an inch to the right. So, everything on the page has to be selected and moved, but only the recto pages. It could be done manually, but I don't know if she is able to do it.

    Try this:
    http://indesignsecrets.com/move-every-object-on-every-page-toward-or-away-from-spine.php

  • Need scripts for fetching groups and subgroups info , script for del users

    Hi ,
    I need a script or macro which will fetch list of groups and sub groups triend forums download did not fine one.
    I need another script which will delete listed users there is a macro in forums but it doesn't suit my rquirement.
    Any one have these scripts handy with you please help me with that,
    Regards,
    Neo.

    Hi Braham,
    Thanks for your quick reply.
    Are we able to do this on two stage method
    1. grab the security groups from the share paths
    if can grab the share path from a separate txt file than copying it to the <your path> location
    so i can modify the txt file
    once run the script
    if can the output like below to a CSV file
    \\servername\foldermain\folder1group 1group 2group 3\\servername\foldermain\folder2group 1group 2group 3then i know which groups belongs to which share paththen i can remove the duplicate groups and keep the common groups to grab the users belongs to itso with the second script same as the first copy the security groups to a txt file and the out put as below.what I needs is the users full name and the samaccount name ( user id )group 1user1user2user3
    group 2user1user2user3looking forward your help on thisThank you.Thilo

  • Need assistance for seeded element configuration in payroll for SA Legislation

    Dear All,
    I am implementing Oracle Fusion Global Payroll for SA Legislation. I referred workforce setup guide for Payroll and supplemental guide for HR and Payroll implementation of SA Legislation.
    However, I am not able to figure out precise configurations needed for Transport Allowance calculation and feed its value to GOSI for further calculations.
    Document 1567452.1 - Oracle Fusion HRMS (Saudi Arabia): HR Implementation and Functional Considerations
    Document 1619159.1 - Oracle Fusion HRMS (Saudi Arabia): Payroll Implementation and Functional Considerations
    Could anyone elaborate configuration needed to achieve below mentioned requirement? As per seeded configuration, system generates Fast Formula for calculation. But element and formula by itself does not achieve required functionality. I know there is additional configuration needed in system but not sure how to proceed ahead with it. I have completed all steps mentioned in above mentioned two documents and yet stuck with non-functioning element.
    Basic Salary: 1000 SAR
    Transport: 10% of Basic Salary (Based on Grade Eligibility)
    I am specifically expediting functionality as below
    1. Manage calculation value definition
    2. Manage Component Group Rules (if applicable)
    3. Attach % Grade Rate to value definition
    Regards,
    Saurabh

    Hi,
    As I mentioned earlier, I added the appropriate balances which are used to calculate Tax to Retro Elements and those Balances got updated with the delta amount but Tax was not updated. I want to know is there any process provided by Oracle using which Tax for those already paid amounts can be recalculated.
    I calculated the Tax manually and using Adjust Balance form added ZA_TAX_BALANCE_ADJUSTMENT Element and given the difference tax amount in PAYE and Tax Input values and saved the form. The Tax got updated.
    Tax_ASG_RUN - 15000
    Tax_ASG_TAX_YTD - 153257.32 (Prev - 138257.32). When I run the IRP5 (Tax Certificate Process) the tax is also getting correctly on it.
    But client wants Oracle to calculate the Tax for those retro amounts so thats the challenge.
    Could you help me with this.
    Thanks,
    Sri

  • Need script for getting Uptime for remote servers

    Hi Guys,
    I'm in need of a script to get the UP time for windows servers in number of days. i have more than 1000 servers.
    I dont want PowerShell script as i have many WIndows 2003 servers where PowerShell is not installed.
    Please help me with this.
    Thanks,
    Kiran Raj

    Hi,
    I'd look at the LastBootUpTime property that can be found by querying Win32_OperatingSystem.
    Don't retire TechNet! -
    (Don't give up yet - 12,700+ strong and growing)

  • Needed: Script for exporting iPhoto albums into a file structure

    Hello all! I have no experience with AppleScript, but I heard it should be possible to write a script which helps to copy/export a iPhoto album structure into an according directory structure. Does anybody already have such a script?
    Thx for any information on that!

    Thomas,
    I have created an AppleScript along with the TextCommands OSAX that duplicates all of the albums in iPhoto to a folder called "Albums" on the desktop. It is quite slow because of the need to open an Info window in Finder to get the path to the original photo but gets the job done.
    If you wish it could be modified to provide an ability to select individual albums for duplication. Let me know if you are interested in the latter. I am also seeing whether the album structure can be created directly in a burn folder so that CDs/DVDs can be rapidly burned.
    TextCommands is donationware and available at the following location:
    http://osaxen.com/files/textcommands1.0.1.html
    and should be placed in the following location for the AppleScript to see it:
    ~/Library/ScriptingAdditions/
    click here to open this script in your editor<pre style="font-family: 'Monaco', 'Courier New', Courier, monospace; overflow:auto; color: #222; background: #DDD; padding: 0.2em; font-size: 10px; width:400px">property PathToDesktop : path to desktop as string
    property PathToPictures : path to pictures folder as string
    property PathToiPhotoLibrary : PathToPictures & "iPhoto Library"
    property PathToiPhotoAlbums : PathToiPhotoLibrary & ":Albums"
    property PathToCopiedAlbums : PathToDesktop & "Albums"
    tell application "Finder"
    activate
    set theCopiedAlbumsFolder to duplicate folder (PathToiPhotoAlbums as alias) to desktop
    set theAlbums to folders of folder PathToCopiedAlbums
    set theExtraneousFiles to files of folder PathToCopiedAlbums
    delete theExtraneousFiles
    repeat with anAlbum in theAlbums
    repeat with anAlias in anAlbum
    -- need to use GUI access to grab the path to the original photo
    open information window of anAlias
    tell application "System Events"
    tell process "Finder"
    -- grab the path to the original file
    set PathToTheOriginalPhoto to value of static text 2 of scroll area 1 of window 1
    end tell
    end tell
    close window 1
    -- need to remove some extraneous material and convert to AppleScript path format
    tell application "TextCommands"
    split PathToTheOriginalPhoto using {":", "../"}
    set PathToTheOriginalPhoto to item 4 of the result
    set PathToTheOriginalPhoto to search PathToTheOriginalPhoto for "/" replacing with ":"
    set PathToTheOriginalPhoto to (PathToiPhotoLibrary & ":" & PathToTheOriginalPhoto) as alias
    end tell
    (* unfortunately there seems to be bug in duplicate file to another folder so must use a copy, , delete the alias, move, and clean up name of copied file sequence to accomplish the equivalent *)
    -- duplicate the original in the original album folder
    set theCopiedPhoto to duplicate PathToTheOriginalPhoto
    -- Delete the alias in the Copied Album
    delete anAlias
    -- Move the copied photo to the Copied Album
    set theCopiedPhoto to move theCopiedPhoto to anAlbum
    -- Remove the "copy" from the photo names
    set NameOfPhoto to name of theCopiedPhoto
    tell application "TextCommands"
    set name of theCopiedPhoto to search NameOfPhoto for " copy" replacing with ""
    end tell
    end repeat
    end repeat
    end tell</pre>
    PowerBook 12" Mac OS X (10.4.6)

  • Needed:  Script for importing Photoshop layers, converting to shape layers

    I've uncovered what seems to be a "bug" in After Effects CS5.  When I import photoshop artwork in layers, and then try to apply effects to an individual layer, such as a color change, a drop shadow, or pretty much anything including puppets, when I later try to render the movie, it crashes.
    My solution has been to laborously go through and convert any layer where I need to apply effects into an AE shape layer, copy the mask over, etc.  Its not much fun, but it does solve the bug.
    I know this could be done with a script, but I don't have the chops or the time to write it.
    Has anybody else written such a script?
    In essence, it needs to:
    1.  import a Photoshop file in layers.
    2.  select each layer in the file and
    3. create an AE layer
    4.copy the mask from the PS layer and
    5. paste it onto the AE layer.
    6. keeping the same registration and
    7. keeping the color of the PS layer.
    Easy, huh?  For somebody who knows what they're doing, which doesn't include me.....
    :<)McFrisco

    Wouldn't it be just more efficient if you provided one of your crashing PSDs along with the AE project so we can check and verify? If you contact me off-forum I can assure you confidentiality and even provide you with an upload location. I even looked up your otehr threads, but I feel we never really reached a point where we could make out something definite, so rather than trying to fix things the hard way, it may make more sense to let someone take a look. This may be something trivial, after all and be perfectly fixable by doing something differently...
    Mylenium

  • Need script for batch Open/Flatten/Outline/Print Preset/Close/Repeat

    I have an Action created that I use in batch mode on deadline day to flatten my artwork, convert text to outlines, print to our press' desired settings (output to postscript file then distilled from there), then close without saving.
    The problem is even tho tho the Action has a step for the desired print preset, I still have to use the dropbox and select it, then click Print to get the action going again- if I take out the icon where it stops the script to wait for my input, then I get a "Can't print the illustration.  The Color Mangement settings are inconsistent"  error.    So I use the dialog icon to use the drop down to select my desired printer.
    From there the action has a 'Close' step where I get a question asking me to Yes or No to save the file.   I want to always answer No to the question as I want to preserve the file from being flattened and outlined- I just want the copy to be.    The action will not save the No answer to that question.
    This forces me be at the computer and select the printer, click the print button, then answer 'No' for ever file in the batch.   I have to do this for a few hundred files-  its a process that takes over an hour. 
    I think I need a script or some help with the Action so I can get up from the chair and walk away while it does it for me.  I've posted here before years ago but got no response.  I've been dealing with what I have.
    PC, Latest version of IllustratorCC2014
    I'm willing to pay for someone to write a script. 

    I'll PM you to try to help you.   Sorry you had to wait so long for a reply.

  • Need script for GREP

    Hi,
    We are using four GREP codes which are applied using paragraph style. We are using CS4. I need a script which i want to apply the GREP code in all para styles automaticaly using javascript.
    Please help us.

    Hey!
    Maybe something like this:
    var myParaStyles = app.activeDocument.allParagraphStyles;
    for (var i = 0; i < myParaStyles.length; i++){
        try{
            var myParaGrep = myParaStyles[i].nestedGrepStyles.add();
            myParaGrep.grepExpression = "{put GREP expression}";
            myParaGrep.appliedCharacterStyle = "{put Character Style Name}";
        catch(_){}
    Don't forget to use escaping when typing GREP expression.
    Hope that helps.
    tomaxxi
    http://indisnip.wordpress.com/

  • Needed Script for Gather Schema Stats

    Hi
    Well i need a script that monitors Gather Schema Schema stats is scheduled for coming week
    In EBS this would be a con current request scheduled that i need to get the information ..
    that script will run once in week and tell us that a GSS is scheduled on or else if its not scheduled it will give an alert as it is not schedule
    please let me know
    Cheers

    Hi Hussein,Alex
    well thanks for your reply ....
    but let me be more more clear what i need ...
    below query
    select ACTUAL_START_DATE, ACTUAL_COMPLETION_DATE,ROUND ( (ACTUAL_COMPLETION_DATE - ACTUAL_START_DATE)*1440) DURATION_MINS, REQUEST_ID, CONCURRENT_PROGRAM_ID from fnd_concurrent_requests where actual_start_date between to_date('4-Jun-12 00:00:00','dd-mon-yy hh24:mi:ss') and to_date('6-July-12 11:00:00','dd-mon-yy hh24:mi:ss')
    and CONCURRENT_PROGRAM_ID in (select CONCURRENT_PROGRAM_ID from FND_CONCURRENT_PROGRAMS_TL where USER_CONCURRENT_PROGRAM_NAME LIKE 'Gather Schema Statistics') order by 5,1;
    this give me output that between this date 4-june-12 to 6-July-12 is there any con current request ran for Gather Schema Stats...
    this query will give me request_id,concurrent_program_id and all details...
    like this i want to see that if any con current request is schedule in near future
    let us for eg
    this script will run on monday and it will pickup up the concurrent request telling for this week on this date GSS is schedule...
    likewise i need ...
    hope this give explanation what exact i need ..
    Cheers........

  • I am new to scripting & I need Script for Document color mode

    Hi,
    Please help me to create a script which should find the Document color mode. I am new to scripting. And please let me know how to use the same.
    Balaji

    Are you using the Extendscript Toolkit Editor (ESTK)? In the Help menu you can find all the properties for Document that can be queried/changed.
    (Personally, I don't use ESTK, because I really really hate it. But I don't want to miss the Help, so I made my own version. I have Illustrator CS4, and it's possible your version doesn't have this, but under Document I find:
    documentColorSpace
    DocumentColorSpace:
    DocumentColorSpace.RGB
    DocumentColorSpace.CMYK
    readonly
    The color space used for the document.
    For the how-to-use I glady refer you to Adobe's own Starting With Scripting guides.)

  • Flash AS3, Need script for .exe to open another .exe file

    Hi all,
    Has anyone got a script to allow an .exe file to open another .exe file? If so, I could sure use the help.
    many thank in advance.
    HD superglide

    You can use fscommand("exec") to run a batch file to open an exe - but exe is a Windows executable, not for Mac OS
    Kenneth Kawamoto
    http://www.materiaprima.co.uk/

Maybe you are looking for