Macro for a css code

Macro for a css code

6
NewbieNewbie
6

    Aug 19, 2005#1

    Hi
    I should want make a macro with Ultraedit for a css code

    I haven't studied the regular expression so that i ask help you

    Dreamweaver Mx write the css code so:

    Code: Select all

    .Menù
    {
    	color: #000000;
    	text-decoration: none;
    	text-align: center;
    	vertical-align: middle;
    	font-family: Georgia, "Times New Roman", Times, serif;
    	font-size: 14px;
    	font-weight: bold;
    	background-image: url(../images/Tabelle/Menù_Sfondo.jpg);
    }
    

    I should want transform the code (with a macro) so:

    Code: Select all

    .Menù
    {
    color: #000000; text-decoration: none; text-align: center;    vertical-align: middle;font-family: Georgia, "Times New Roman", Times, serif; font-size: 14px; font-weight: bold; background-image: url(../images/Tabelle/Menù_Sfondo.jpg);
    }
    
    Can you write me a macro that transform code in this mode?

    206
    MasterMaster
    206

      Aug 19, 2005#2

      Try this out. Select all the text (but not the braces), then run the macro.


      InsertMode
      ColumnModeOff
      HexOff
      UnixReOn
      Find RegExp "\p"
      Replace All SelectText ""
      Find RegExp "(vertical-align: )"
      Replace All SelectText "\1\p"
      Find RegExp "(font-size.*;))"
      Replace All SelectText "\1\p"
      Find RegExp "^([^ ])"
      Replace All SelectText " \1"
      EndSelect
      Key HOME
      Software For Metalworking
      http://closetolerancesoftware.com

      6
      NewbieNewbie
      6

        Aug 19, 2005#3

        How to do to select all except the brace...?

        206
        MasterMaster
        206

          Aug 19, 2005#4

          Select (highlight the text) using your mouse or keyboard. Instructions will be in the Help file.
          Software For Metalworking
          http://closetolerancesoftware.com

          6
          NewbieNewbie
          6

            Aug 20, 2005#5

            I have made a search in the user guide of Ultraedit...but

            I don't succeed in the search

            and to select only the text


            Can you help me?

            206
            MasterMaster
            206

              Aug 20, 2005#6

              What I mean is, select all the text in your css code, except for the opening and closing braces. Select it in the same way you would if you were going to Cut it and Paste it somewhere else. However, instead of Cutting it, run the macro to modify the selected text.

              Sorry, but I don't know how else to explain it.
              Software For Metalworking
              http://closetolerancesoftware.com

              6,686585
              Grand MasterGrand Master
              6,686585

                Aug 22, 2005#7

                Maybe this macro is easier to use for you. Set the cursor anywhere inside the area defined by the brackets {} or directly at the opening { bracket and run the macro.

                There is only 1 regular expression replace and because the syntax for this simple regular expression is identical for UltraEdit and Unix regular expression, I removed the UnixReOn/UnixReOff command. So it can be used by everyone whithout fear off the Unix regular expression setting stored in the ini-file.

                InsertMode
                ColumnModeOff
                HexOff
                IfCharIs "{"
                Key DOWN ARROW
                Else
                Find Up "{"
                Key HOME
                Key DOWN ARROW
                EndIf
                StartSelect
                Find Select "}"
                Key UP ARROW
                Key END
                Find "^p"
                Replace All SelectText ""
                Find RegExp " +"
                Replace All SelectText " "
                EndSelect
                Find Up "{"
                Key HOME
                Best regards from an UC/UE/UES for Windows user from Austria