Replace with exact case?

I have a shopping cart manager for some users where they can
submit descriptive text to a database for the product. Before the
insert/update I will be looping through a table of keywords
associated with URL's and do replace functions on words in their
text to create hyperlinks.
My problem is how can I put a hyperlink around a word or
phrase (which could occur many times in the text) yet still retain
the case of that word.
Example:
My table contains the term "Ascorbic Acid", but the text they
submitted has it as "ascorbic acid". Now I can do a ReplaceNoCase
to get the match, but it would end up doing this <a
href="myurl">Ascorbic Acid</a>, when in context to their
text it should be <a href="myurl">ascorbic acid</a>.
Anyone have any ideas?

Sorry, but that will not work in my case because there will
be many "user-provided-keyword-text-goes-here " all through many
paragraphs of text that CF will need to find using a table of
keywords and then putting a hyper link around ALL the matches.

Similar Messages

  • How to download a smartform output as excel file WITH EXACT LAYOUT.

    Hi,
         I have searched the forum but could not found any satisfactory answer. I have a smartform with a table, some texts and a logo. I have to write a code which will save the smartform output as excel file in the system keeping the layout of the smartform output EXACT.
    i.e., the excel file will contain the output with EXACTLY THE SAME layout as would have been for a pdf file (if the smartform output is converted to a pdf file) and the client can then edit the fields of the table in the excel file.  How can I achieve this? Please give a suggestion.. Thanks in advance.

    Hi Anirban,
    Your Requirement is to download a smartform to  microsoft  Excel .
    Well unfortunately we can only download data into excel which is in a tabular format i.e stored in internal tables we have function modules to do the same even u can do that using OLE2.
    If u try to download a smartform to Excel only format supported will be ASCII, if u will continue with that the smartforms text's will get downloaded to excel but whole data would be downloaded in a single Cell.
    Code to do the same is -
    >>>>
    CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
      EXPORTING
      i_language = v_language
      i_application = 'SAPDEFAULT'
      IMPORTING
      e_devtype = v_e_devtype.
       CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          FORMNAME                 = w_form
    *   VARIANT                  = ' '
    *   DIRECT_CALL              = ' '
       IMPORTING
         FM_NAME                  =  w_fmname
       EXCEPTIONS
         NO_FORM                  = 1
         NO_FUNCTION_MODULE       = 2
         OTHERS                   = 3
      IF sy-subrc <> 0.
        MESSAGE E002(zcpm) WITH 'Smartform call fails'.
      ENDIF.
    wa_outopt-tdprinter = v_e_devtype.
    wa_ctrlop-no_dialog = 'X'.
    wa_ctrlop-getotf    = 'X'.
      CALL FUNCTION w_fmname "'/1BCDWB/SF00000025'
        EXPORTING
    *   ARCHIVE_INDEX              =
    *   ARCHIVE_INDEX_TAB          =
    *   ARCHIVE_PARAMETERS         =
        CONTROL_PARAMETERS         = WA_CTRLOP
    *   MAIL_APPL_OBJ              =
    *   MAIL_RECIPIENT             =
    *   MAIL_SENDER                =
        OUTPUT_OPTIONS             = WA_OUTOPT
    *    USER_SETTINGS              = ' '
        IMPORTING
    *   DOCUMENT_OUTPUT_INFO       =
        JOB_OUTPUT_INFO            = T_OTFDATA
    *   JOB_OUTPUT_OPTIONS         =
    *    document_output_info       = st_document_output_info
    *    job_output_info            = st_job_output_info
    *    job_output_options         = st_job_output_options
        TABLES
          T_FINAL                    = T_FINAL
          T_ZSDT_WAGONS              = T_ZSDT_WAGONS_1
          T_QTY                      = T_QTY
          T_QTY1                     = T_QTY1
          T_CON1                     = T_CON1
          T_CON2                     = T_CON2
          "T_ZTMM_OUTWB_TXN           = T_ZTMM_OUTWB_TXN
    EXCEPTIONS
       FORMATTING_ERROR           = 1
       INTERNAL_ERROR             = 2
       SEND_ERROR                 = 3
       USER_CANCELED              = 4
       OTHERS                     = 5
      IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    T_OTF[] = T_OTFDATA-OTFDATA[].
    CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
              format = 'ASCII'
              max_linewidth = 132
    * ARCHIVE_INDEX = ' '
    IMPORTING
              bin_filesize = w_bin_filesize
    TABLES
              otf   = t_otf
              lines = t_pdf_tab
    EXCEPTIONS
              err_max_linewidth = 1
              err_format = 2
           err_conv_not_possible = 3
    OTHERS = 4
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    if tabix_m = 1.
    *CALL METHOD cl_gui_frontend_services=>file_save_dialog
    *CHANGING
    *filename = w_FILE_NAME
    *path     = w_FILE_PATH
    *fullpath = w_FULL_PATH
    ** USER_ACTION =
    ** FILE_ENCODING =
    *EXCEPTIONS
    *CNTL_ERROR = 1
    *ERROR_NO_GUI = 2
    *NOT_SUPPORTED_BY_GUI = 3
    *others = 4
    *IF sy-subrc <> 0.
    *MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *ENDIF.
    CALL function 'TMP_GUI_BROWSE_FOR_FOLDER'
    EXPORTING
    WINDOW_TITLE = 'Select A File Folder'
    INITIAL_FOLDER = 'C:\'
    IMPORTING
    SELECTED_FOLDER = W_PATH.
    endif.
    CONDENSE W_PATH.
    concatenate W_PATH '\' wa_final-vbeln '.XLS' into w_FULL_PATH.
    ****************************************************************************Saving the PDF file on to Application server************************
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
       BIN_FILESIZE                     = w_bin_filesize
       FILENAME                         = w_FULL_PATH
       FILETYPE                         = 'BIN'
    *   APPEND                          = ' '
    *   WRITE_FIELD_SEPARATOR           = ' '
    *   HEADER                          = '00'
    *   TRUNC_TRAILING_BLANKS           = ' '
    *   WRITE_LF                        = 'X'
    *   COL_SELECT                      = ' '
    *   COL_SELECT_MASK                 = ' '
    *   DAT_MODE                        = ' '
    *   CONFIRM_OVERWRITE               = ' '
    *   NO_AUTH_CHECK                   = ' '
    *   CODEPAGE                        = ' '
    *   IGNORE_CERR                     = ABAP_TRUE
    *   REPLACEMENT                     = '#'
    *   WRITE_BOM                       = ' '
    *   TRUNC_TRAILING_BLANKS_EOL       = 'X'
    *   WK1_N_FORMAT                    = ' '
    *   WK1_N_SIZE                      = ' '
    *   WK1_T_FORMAT                    = ' '
    *   WK1_T_SIZE                      = ' '
    IMPORTING
       FILELENGTH                      = w_filesize
      TABLES
        DATA_TAB                        = t_pdf_tab
    *   FIELDNAMES                      =
    EXCEPTIONS
       FILE_WRITE_ERROR                = 1
       NO_BATCH                        = 2
       GUI_REFUSE_FILETRANSFER         = 3
       INVALID_TYPE                    = 4
       NO_AUTHORITY                    = 5
       UNKNOWN_ERROR                   = 6
       HEADER_NOT_ALLOWED              = 7
       SEPARATOR_NOT_ALLOWED           = 8
       FILESIZE_NOT_ALLOWED            = 9
       HEADER_TOO_LONG                 = 10
       DP_ERROR_CREATE                 = 11
       DP_ERROR_SEND                   = 12
       DP_ERROR_WRITE                  = 13
       UNKNOWN_DP_ERROR                = 14
       ACCESS_DENIED                   = 15
       DP_OUT_OF_MEMORY                = 16
       DISK_FULL                       = 17
       DP_TIMEOUT                      = 18
       FILE_NOT_FOUND                  = 19
       DATAPROVIDER_EXCEPTION          = 20
       CONTROL_FLUSH_ERROR             = 21
       OTHERS                          = 22
    As u said ,u want to download a smartform to Excel it could be done but only if u r using a internal table and exactly printing line by line values in the smartform, But if u are performing calculation in between, using multiple internal table Work areas, structures, etc i.e if whole smartform is developed with many distributed windows , unfortunately it wont be possible to download a smartform to excel in such cases, because the whole output comes from multiple internal tables, calculations, etc all the data is not printed in a tabular manner so in such a case it would be just impossible to download the smartform  to excel.
    But we definitely have a workaround which could be done to download the data into excel.
    you can develop a ALV report with a header and footer u can define the header and footer of the alv according to the smartform and the middle portion would contain the tabular kind of data which u must be using as Smartform table to print the same.
    So if u have a similar kind of smartform with some header data, tabular data, and some footer data, then u can use ALV to do the same thing , advantage with ALV would be that u can easily download the same into excel.
    Other alternative is that u can Convert and download the smartform to PDF  and copy the same to an Excel wooksheet.
    These are all the possibilities with which u can do the same.
    Regards,
    Akash Rana

  • [CS2][JS] Search text & replace with inline Image

    I am working with a large layout with many entries. There is a text "placeholder" that I need to search for and replace with an inline image in that exact spot.
    I need to apply an Object Style to that image.
    There is a loop above this for each find/replace to perfom
    I have supplied samples to show what the variables will hold
    The following assumes that an Objectstyle named "image" exists
    //places the image
    app.changePreferences = null;
    findName = "OR-00014500-24-0000-1";
    fileName = "Ads:OR-00014500-24-0000-1:OR-00014500-24-0000-1.eps"
    myFinds = app.search(findName)
    for (j = myFinds.length - 1; j >= 0; j--) {
    app.select(myFinds[j]);
    app.place(fileName, false,{appliedObjectStyle:"image"});
    This doesn't apply the style to the placed object and I have tried many different ways to apply this in the properties.
    Any help would be appreciated.

    I've seem to hit another hurdle....
    The code works well for searching and replacing the images. It applies the style to the image, but these images are not inline they are anchored. I ended up with a nice stack of images in the same corner.
    Ok... I need to then apply styles based on the images that have been placed already..
    This works well for cycling through the pages and with a bit more will change the style...
    myDoc = app.activeDocument;
    pagecount = myDoc.pages.length;
    for ( page=0; page < pagecount; page++){
    if (myDoc.pages.item(page).textFrames.length != 0){
    app.select(myDoc.pages.item(page).textFrames.item(0));
    piccount = app.selection[0].rectangles.length;
    if (piccount != 0){
    for ( bob=0; bob < piccount; bob++){
    app.select(myDoc.pages.item(page).textFrames.item(0));
    app.select(app.selection[0].rectangles.item(bob));
    // Get geometric bounds
    // alert(app.selection[0].geometricBounds);
    // Get object Style
    // alert(app.selection[0].appliedObjectStyle.name);
    // Do more here....
    I can't use this though :(
    I need to determine how many images have already been placed on the page before placing the image in the search and replace....
    myFinds = app.search(replaceName)
    for (j = myFinds.length - 1; j >= 0; j--) {
    app.select(myFinds[j]);
    myStory = myFinds[j].parent;
    myIndex = myFinds[j].index;
    //This will change using a series of Case Switches
    // Here is where I need to find the page and run the previous script or something like it myStyle = app.activeDocument.objectStyles.item("image");
    app.place(fileName, false);
    myStory.characters[myIndex].pageItems[0].applyObjectStyle(myStyle);
    app.select(myStory.characters[myIndex].pageItems[0]);
    //alert(app.selection[0].appliedObjectStyle.name);
    What I need to do is kind of combine the two....
    But I can't seem to get the current page of the selected image....
    I could use the page by page script, but it moves the character anchor point of images and pushes them to the next page. This throws off the pretty layout I'm going for.
    What am I doing wrong here ?

  • Find and replace with multiple files and with a watch folder

    I am trying to create a watch folder that uses red_menace script to:
    1. Have a folder that receives multiple xml files that run the script one by one.
    2. then move the files to an output folder.
    I tried modifying the set TheFIle to choose file -- the original text file to:
    with multiple selections allowed
    But that doesn't seem to work. I know i'm missing a step. Any help is much appreciated!
    Thanks!
    The way i'd like to setup things is having an input folder on the desktop (or just have the application on the desktop and I can drag the files onto it), and let it do it's thing. Once it's done have it export the xml files into an output folder.
    Here's what i got so far:
    on open
    set TheFIle to choose file -- the original text file
    set TheFolder to ("Macintosh HD:Users:user1:Desktop:out") -- the folder for the output file
    set TheName to (GetUniqueName for TheFIle from TheFolder) -- the name for the output file
    set TheText to read TheFIle -- get the text to edit
    set Originals to {"KPCALDATE", "KPCALEVENT", "KPCALDAY", "KPCALBODY", "obituaries name", "" & return & "</cstyle></pstyle>" & return & "<pstyle name=\"obituaries text\"><cstyle>", "<pstyle name=\"obituaries text\"><cstyle name=\"Graphics Bold leadin\" font=\"ADV AGBook-Medium 2\">", "<pstyle name=\"Recipe Ingredients\"><cstyle>", " .com", " .net", " .org", " .edu", "www .", "www. ", "Ho- nolulu", "<pstyle name=\"kicker 12\"><cstyle allcaps=\"1\">fashion news</cstyle><cstyle allcaps=\"1\">" & return & "</cstyle></pstyle>" & return & "", "<component name=\"Headline 1\" type=\"Headline\">" & return & "<header>" & return & "<field name=\"Component name\" type=\"string\" value=\"Headline 1\"/>" & return & "<field name=\"Component type\" type=\"popup\" value=\"Headline\"/>" & return & "</header>" & return & "<body>" & return & "<pstyle name=\"hed STANDARD 36\"><cstyle>", "<pstyle name=\"obituaries text\"><cstyle allcaps=\"1\">", "<pstyle name=\"obituaries text\"><cstyle name=\"Graphics Bold leadin\">", "<pstyle name=\"tagline\"><cstyle>-", "-", "
    Per serving:", "<pstyle name=\"Titlebar - mini, red\"><cstyle allcaps=\"1\">NATION & World </cstyle><cstyle allcaps=\"1\">Report</cstyle><cstyle allcaps=\"1\">" & return & "</cstyle></pstyle>" & return & "", "</cstyle></pstyle>"} -- the terms that can be replaced
    set Replacements to {"subhed", "subhed", "subhed", "Normal", "obituaries text", ", ", "<pstyle name=\"obituaries text\"><cstyle name=\"Graphics Bold leadin\" font=\"ADV AGBook-Medium 2\">", "<pstyle name=\"Recipe Ingredients\"><cstyle>
    ", ".com", ".net", ".org", ".edu", "www.", "www.", "Honolulu", "", "<component name=\"Headline1\" type=\"Headline\">" & return & "<header>" & return & "<field name=\"Component name\" type=\"string\" value=\"Headline1\"/>" & return & "<field name=\"Component type\" type=\"popup\" value=\"Headline\"/>" & return & "</header>" & return & "<body>" & return & "<pstyle name=\"hed STANDARD 27\"><cstyle>", "<pstyle name=\"obituaries text\"><cstyle allcaps=\"1\">", "<pstyle name=\"obituaries text\"><cstyle name=\"Graphics Bold leadin\">", "<pstyle name=\"tagline\"><cstyle>—", " —", "
    Per serving:", "","" & return & "</cstyle></pstyle>"} -- the replacement terms
    repeat with AnItem from 1 to count Originals
    set TheText to (replaceText of TheText from (item AnItem of Originals) to (item AnItem of Replacements))
    end repeat
    try -- write a new output file
    tell application "Finder" to make new file at TheFolder with properties {name:TheName}
    set OpenFile to open for access (result as alias) with write permission
    write TheText to OpenFile starting at eof
    close access OpenFile
    on error errmess
    try
    log errmess
    close access OpenFile
    end try
    end try
    end open
    to GetUniqueName for SomeFile from SomeFolder
    check if SomeFile exists in SomeFolder, creating a new unique name if needed
    parameters - SomeFile [mixed]: a source file path
    SomeFolder [mixed]: a folder to check
    returns [text]: a unique file name and extension
    set {Counter, Divider} to {"00", "_"}
    -- get the name and extension
    set {name:TheName, name extension:TheExtension} to info for file (SomeFile as text)
    if TheExtension is missing value then set TheExtension to ""
    set TheName to text 1 thru -((count TheExtension) + 2) of TheName
    set NewName to TheName & "." & TheExtension
    tell application "System Events" to tell (get name of files of folder (SomeFolder as text))
    repeat while it contains NewName
    set Counter to text 2 thru -1 of ((100 + Counter + 1) as text) -- leading zero
    set NewName to TheName & Divider & Counter & "." & TheExtension
    end repeat
    end tell
    return NewName
    end GetUniqueName
    to EditItems of SomeItems given Title:TheTitle, Prompt:ThePrompt
    displays a dialog for multiple item edit (note that a return is used between each edit item)
    for each of the items in SomeItems, a line containing it's text is placed in the edit box
    the number of items returned are padded or truncated to match the number of items in SomeItems
    parameters - SomeItems [list]: a list of text items to edit
    TheTitle [boolean/text]: use a default or the given dialog title
    ThePrompt [boolean/text]: use a default or the given prompt text
    returns [list]: a list of the edited items, or {} if error
    set {TheItems, TheInput, TheCount} to {{}, {}, (count SomeItems)}
    if TheCount is less than 1 then return {} -- error
    if ThePrompt is in {true, false} then -- "with" or "without" Prompt
    if ThePrompt then
    set ThePrompt to "Edit the following items:" & return -- default
    else
    set ThePrompt to ""
    end if
    else -- fix up the given prompt a little
    set ThePrompt to ThePrompt & return
    end if
    if TheTitle is in {true, false} then if TheTitle then -- "with" or "without" Title
    set TheTitle to "Multiple Edit Dialog" -- default
    else
    set TheTitle to ""
    end if
    set {TempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, return}
    set {SomeItems, AppleScript's text item delimiters} to {SomeItems as text, TempTID}
    set TheInput to paragraphs of text returned of (display dialog ThePrompt with title TheTitle default answer SomeItems)
    repeat with AnItem from 1 to TheCount -- pad/truncate entered items
    try
    set the end of TheItems to (item AnItem of TheInput)
    on error
    set the end of TheItems to ""
    end try
    end repeat
    return TheItems
    end EditItems
    to replaceText of SomeText from OldItem to NewItem
    replace all occurances of OldItem with NewItem
    parameters - SomeText [text]: the text containing the item(s) to change
    OldItem [text]: the item to be replaced
    NewItem [text]: the item to replace with
    returns [text]: the text with the item(s) replaced
    set SomeText to SomeText as Unicode text -- TID's are case insensitive with Unicode text
    set {TempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, OldItem}
    set {ItemList, AppleScript's text item delimiters} to {text items of SomeText, NewItem}
    set {SomeText, AppleScript's text item delimiters} to {ItemList as text, TempTID}
    return SomeText
    end replaceText
    Message was edited by: gamebreakers

    When you use the open or adding folder items to handlers, you need to add the parameters for the file items passed to them.
    I'll go ahead and post the applet/droplet version of my original script from the previous topic for reference:
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px; height: 340px;
    color: #000000;
    background-color: #FFEE80;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    -- search and replace multiple items applet/droplet/folder action
    -- the terms to replace - edit as needed
    property EditableItems : {¬
    "one", ¬
    "two", ¬
    "three", ¬
    "four", ¬
    "five", ¬
    "six", ¬
    "seven", ¬
    "eight", ¬
    "nine", ¬
    "ten", ¬
    "eleven", ¬
    "twelve", ¬
    "thirteen", ¬
    "fourteen", ¬
    "fifteen", ¬
    "sixteen", ¬
    "seventeen", ¬
    "eighteen", ¬
    "nineteen", ¬
    "twenty"}
    -- the folder for the output file(s) - change as needed
    property TheFolder : (path to desktop)
    property LastEditItems : EditableItems
    on run
    the applet/droplet was double-clicked
    open (choose file with multiple selections allowed)
    end run
    on open TheItems
    items were dropped onto the applet/droplet
    parameters - TheItems [list]: a list of the items (aliases) dropped
    returns nothing
    repeat with AnItem in TheItems
    ReplaceMultipleItems from AnItem
    end repeat
    end open
    on adding folder items to this_folder after receiving these_items
    folder action - items were added to a folder
    parameters - this_folder [alias]: the folder added to
    these_items [list]: a list if items (aliases) added
    returns nothing
    repeat with AnItem in these_items
    ReplaceMultipleItems from AnItem
    end repeat
    end adding folder items to
    to ReplaceMultipleItems from SomeFile
    replace multiple text items in SomeFile
    parameters - SomeFile [alias]: the file to replace items in
    returns nothing
    set TheName to (GetUniqueName for SomeFile from TheFolder) -- the name for the output file
    set TheText to read SomeFile -- get the text to edit
    set Originals to (choose from list EditableItems default items LastEditItems with prompt "Select the terms to replace:" with multiple selections allowed) -- the specific terms to replace
    set LastEditItems to Originals
    set Replacements to (EditItems of Originals with Title given Prompt:"Edit the following replacement terms:") -- the replacement terms
    repeat with AnItem from 1 to count Originals
    set TheText to (ReplaceText of TheText from (item AnItem of Originals) to (item AnItem of Replacements))
    end repeat
    try -- write a new output file
    tell application "Finder" to make new file at TheFolder with properties {name:TheName}
    set OpenFile to open for access (result as alias) with write permission
    write TheText to OpenFile starting at eof
    close access OpenFile
    on error errmess
    try
    log errmess
    close access OpenFile
    end try
    end try
    end ReplaceMultipleItems
    to GetUniqueName for SomeFile from SomeFolder
    check if SomeFile exists in SomeFolder, creating a new unique name if needed
    parameters - SomeFile [mixed]: a source file path
    SomeFolder [mixed]: a folder to check
    returns [text]: a unique file name and extension
    set {Counter, Divider} to {"00", "_"}
    -- get the name and extension
    set {name:TheName, name extension:TheExtension} to info for file (SomeFile as text)
    if TheExtension is in {missing value, ""} then
    set TheExtension to ""
    else
    set TheExtension to "." & TheExtension
    end if
    set {NewName, TheExtension} to {TheName, (ChangeCase of TheExtension to "upper")}
    set TheName to text 1 thru -((count TheExtension) + 1) of TheName
    tell application "System Events" to tell (get name of files of folder (SomeFolder as text))
    repeat while it contains NewName
    set Counter to text 2 thru -1 of ((100 + Counter + 1) as text) -- leading zero
    set NewName to TheName & Divider & Counter & TheExtension
    end repeat
    end tell
    return NewName
    end GetUniqueName
    to EditItems of SomeItems given Title:TheTitle, Prompt:ThePrompt
    displays a dialog for multiple item edit (note that a return is used between each edit item)
      for each of the items in SomeItems, a line containing it's text is placed in the edit box
        the number of items returned are padded or truncated to match the number of items in SomeItems
    parameters - SomeItems [list]: a list of text items to edit
    TheTitle [boolean/text]: use a default or the given dialog title
    ThePrompt [boolean/text]: use a default or the given prompt text
    returns [list]: a list of the edited items, or {} if error
    set {TheItems, TheInput, TheCount} to {{}, {}, (count SomeItems)}
    if TheCount is less than 1 then return {} -- error
    if ThePrompt is in {true, false} then -- "with" or "without" Prompt
    if ThePrompt then
    set ThePrompt to "Edit the following items:" & return -- default
    else
    set ThePrompt to ""
    end if
    else -- fix up the given prompt a little
    set ThePrompt to ThePrompt & return
    end if
    if TheTitle is in {true, false} then if TheTitle then -- "with" or "without" Title
    set TheTitle to "Multiple Edit Dialog" -- default
    else
    set TheTitle to ""
    end if
    set {TempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, return}
    set {SomeItems, AppleScript's text item delimiters} to {SomeItems as text, TempTID}
    set TheInput to paragraphs of text returned of (display dialog ThePrompt with title TheTitle default answer SomeItems)
    repeat with AnItem from 1 to TheCount -- pad/truncate entered items
    try
    set the end of TheItems to (item AnItem of TheInput)
    on error
    set the end of TheItems to ""
    end try
    end repeat
    return TheItems
    end EditItems
    to ReplaceText of SomeText from OldItem to NewItem
    replace all occurances of OldItem with NewItem
    parameters - SomeText [text]: the text containing the item(s) to change
    OldItem [text]: the item to be replaced
    NewItem [text]: the item to replace with
    returns [text]: the text with the item(s) replaced
    set SomeText to SomeText as text
    if SomeText contains OldItem then
    set {TempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, OldItem}
    try
    set {ItemList, AppleScript's text item delimiters} to {text items of SomeText, NewItem}
    set {SomeText, AppleScript's text item delimiters} to {ItemList as text, TempTID}
    on error ErrorMessage number ErrorNumber -- oops
    set AppleScript's text item delimiters to TempTID
    error ErrorMessage number ErrorNumber
    end try
    end if
    return SomeText
    end ReplaceText
    to ChangeCase of SomeText to CaseType
    changes the case or capitalization of SomeText to the specified CaseType using Python
    parameters - SomeText [text]: the text to change
    CaseType [text]: the type of case desired:
    "upper" = all uppercase text
    "lower" = all lowercase text
    "title" = uppercase character at start of each word, otherwise lowercase
    "capitalize" = capitalize the first character of the text, otherwise lowercase
    returns [text]: the changed text 
    set SomeText to SomeText as text
    if CaseType is not in {"upper", "lower", "title", "capitalize"} then return SomeText
    return (do shell script "/usr/bin/python -c \"import sys; print unicode(sys.argv[1], 'utf8')." & CaseType & "().encode('utf8')\" " & quoted form of SomeText)
    end ChangeCase
    </pre>
    Edit: how does the choose from list dialog handle those big strings? I'm guessing not very well - is that why you avoided using them?
    Message was edited by: red_menace

  • I have a power pc (g5) computer that I will soon be replacing with a current i5 or i7 mini. How do I transfer the Time Machine files from the internal hard drive on the G5 to an external drive that I will later use with the Mini?

    I have a Power PC G5 computer that I will soon be replacing with a current i5 or i7 Mini. How do I transfer the Time Machine files from the internal hard drive on the G5 to an external drive that I will later use with the Mini?

    Hi, likely the easiest is to just poll the drive & get something like this...
    Get MacScan...
    http://www.apple.com/downloads/macosx/networking_security/macscan.html
    http://eshop.macsales.com/item/NewerTech/U3NVSPATA/
    But if you have a good external drive already, just clone it.
    Get carbon copy cloner to make an exact copy of your old HD to the New one...
    http://www.bombich.com/software/ccc.html
    Or SuperDuper...
    http://www.shirt-pocket.com/SuperDuper/

  • If my battery life is getting lower  and lower, can I get my iPod replaced with a new one with the guaranty?

    Bought my iPod 10months ago, now the battery life is really bad!!! I need to know if I can get it replaced with the guaranty! Thanks :)

    I'd make an appointment at your local apple store, have them check it out and see what they say. If they determine that it's a manufacturer's defect then they may replace it.
    In case they do, I'd do a full sync and backup before you take it in.

  • Logo replaced with "No items found" after testing a form submission

    I'm quickly coming to the conclusion that Business Catalyst is written by the programmers, for the programmers, to be primarily used by the BC programmers to set up the initial web sites for end users and once everything is customized, the end user /site owner can then update product pages and other content, without knowing any code. IMHO, it was not written for Web designers who know how to build static web sites, but who also need added functionality.
    Moreover, I thought the propose of BC was to build a professional looking and properly performing interactive web sites without knowing any coding. Even with knowing HTML, CSS, and some Javascript, it is one confusing mess, that does not perform as advertised, IN MY OPINION. You not only have to thoroughly understand how BC does things, and I seriously doubt that a custom site could be effectively built without knowing programming, or at least a working knowledge of Javascript, which most web designers have not mastered. Javascript is NOT easy, but neither is Business Catalyst.
    Even the sample starter sites do not function smoothly, and the BC Manage site interface is NOT intuitive, so unless you want a web site that basically looks and functions just like one of the templates, you're out of luck. Maybe someone on this forum can explain how, and why, my header logo got 'replaced' with the words, "No items found"? All I did was attempt to set up a module form and then tested it. Next I was unable to log into the site with any accounts that I had set up as a User and/or member for testing purposes, which worked just fine before then.
    I have just spent the better part of the last two-three week trying to figure out how to use Business Catalyst and slightly modify one of the provided BC sites to meet my needs. No such luck. I am a long time Adobe customer and have spent thousands of dollars on Adobe Software over the last ten plus years, but BC is a LOOSER. I'm NOT a stupid person, and have designed some nice responsive HTML5 web sites, but Business Catalyst has thrown me for a loop, even though I have tried diligently to figure out how all the pieces fit and work together, to little avail.
    Why doesn't Adobe provide some programming help (for a reasonable programming fee) instead of forcing us to go with the independent BC programmers/site designers who do know how to make it work, but they charge the big bucks to do so? I had one BC site designer tell me that web sites cost $10,000 - $15,000. (and that was for a BC site) which I thought was quite unreasonable until you consider how few people truly know how to use BC well enough to customize a web site, and then you have to need a site very similar to the one already created. There in an inherent lack of simple functionality, and customization, for sites that are not retail product sites.
    Frankly, I am very disappointed, frustrated, and now looking for a programmer to build a straightforward interactive site for my modest needs. Who cares about all those reports if you can't get the site to function properly, and are unable to troubleshoot the problems when everything is hidden in content holders with no access, and no list of all the modules that are even being used on the site I was last trying to modify.  The Announcement module was not to be found anywhere, except in the code that somehow managed to switch out the site logo in the header with search results. Doubt if I could duplicate the problem if I tried.
    BC is too complex on the backend, and doesn't make much common sense on the front management end. It tries to be all things to all retail selling sites, but all those functions, bells & whistles aren't much good if a user can't get the site off the ground.
    At the very least, give us access to the all the modules uses on the sample sites (not al are available within the site management), the module names, and a brief description of what they do and how to access them when they are nowhere found in the module templates directory. And would someone PLEASE write some decent directions for using the management interface, instead of glibly showing how easy it is to do this or that, without any coding, but also without any real walk-throughs of exactly how to do something specific.
    My apology to EVERYONE on this forum for my venting and rant out of sheer frustration ( and deadlines that are not being met) and I do NOT fault the forum moderator for NOT POSTING my thoughts, but I do hope this message, written in utter frustration, is FORWARDED to someone at Adobe who needs to know the truth of the matter regarding Business Catalyst, from at least my own VERY BAD USER EXPERIENCE, thus far,  spent trying to get results creating a simple interactive web site using Business Catalyst.
    I'm guessing some of you are frustrated and struggling as well. I wish you the best and every success in using Business Catalyst. Typically I am patient, and will keep on trying... but only to a point, at which it's time for me to move on to plan C, because the real 'help' I need is with all the little stuff that doesn't work and tutorials are definitely lacking unless you have that same problem or are trying to duplicate what is being explained - I've tried BG Gurus videos, Lynda.com training, and other Youtube BC resources.
    Sincerely,
    Heidi Wurst

    the need for both a "testing" and "remote" server for the site and that the information in the 'add server form' needed to be correct.
    You do not need both, you only need the the server that you want to use. I have a test site that I only use locally, so that is the server that I have setup, thus no remote server.
    how many ftp addresses can I expect to have!
    Just one per site, the correct one.
    Gramps

  • When usung google search I get a listing but when I click on it gets replace with spam

    When usung google search I get a listing but when I click on a link it gets replace with spam. I notice a half blue spiral in front of the link that pops up.
    == This happened ==
    Every time Firefox opened
    == every time I use use the Google Search in firefox

    This seems to be going around. I haven't studied it in detail, but here is an example of a removal guide:
    http://malwaretips.com/blogs/trovi-com-removal/
    ''There are many other removal guide sites, but often they are designed to confuse you so you purchase paid support services. Most likely you won't need to do that in this case.''
    Please also see our support article on cleaning up malware, and the specialized forums listed toward the end: [[Troubleshoot Firefox issues caused by malware]].
    In the short run, assuming an extension is to blame, you may want to use Firefox in its Safe Mode. That's a standard diagnostic tool to deactivate extensions and some advanced features of Firefox. More info: [[Troubleshoot Firefox issues using Safe Mode]].
    You can restart Firefox in Safe Mode using either:
    * "3-bar" menu button > "?" button > Restart with Add-ons Disabled
    * Help menu > Restart with Add-ons Disabled
    Not all add-ons are disabled: Flash and other plugins still run
    After Firefox shuts down, a small dialog should appear. Click "Start in Safe Mode" (''not'' Reset).

  • If i want to replace the back case for an iphone 3g and i provide the back case, will Apple do the actual replacement for me?

    The black back case on my iphone 3g is cracked. i would like to replace the back case with a new white one. I saw the video on how to do the replacement on youtube and found it complicated. if i take the new back case and the phone to Apple, will the replace the broken back case for me?

    Regarding the iPhone 3G, the only repair that Apple Genius does on that device is the Front Screen Replacement. So they could help you get the front assembly back on when you are done with the repair. To give you a better idea, the Genius do not even replace the battery on the iPhone 3G. Apple will not help you with this repair.

  • Name search with and with out case sensitive including * also.

    there is an urgent reuirement for name search .
    i am having 6 fields all are related to name like name prefix ,firstname, lastname etc. now i want select query so that i can search the person name with case ,with out case sensitive and ' * ' also.
    and one more thing
    i am having multiple selection for first name,lastname etc.
    so i must write select query for >=, = , <= etc also along with ' * ' .
    so can any one help me, requirement is urgent.
    i cannot add one more field in database.

    Hi, I did not understand your problem exactly, but I am sending you an sample query according to my understanding.
    select <fields names> from <tablename> where name = '%xxx'.
    here % is used for searching for all the names which ends with 'xxx'
    If you give some more details briefly then I can try for you.

  • 3 cracks in 3 years replaced with a 3 year warranty!!!

    Dear Ms./Sir,
    I am a university student and in 2007 I have bought my very first laptop ever, a white Macbook. I love my laptop. It's fast, it's convenient. The design is slick and thin, fits anywhere and it's light. However, since I bought it I realized that regular Microsoft laptops have sturdy cases but their software falls apart. In the case of a MacBook, excellent software but the case falls apart. This is ridiculous. I am a big fan of Apple products and have bought many as presents as well in the past. I avidly recommended and still am to friends and family. However with the case cracking constantly and in constant need of replacement I am definitely over thinking my loyalty to Apple in the future.
    Mid 2008 I notice the first crack on the right side of the board. Having a 3 year warranty through Apple Care I was able to replace it at no cost. I hoped that it wouldn't happen again and made sure that I used it lightly and very carefully to avoid another crack. Early 2009 another crack, same place. Replaced it again at no cost. This time I decided not to even take it to school anymore and was really really careful with it. November 2009, not even a year later another crack in the SAME spot. This is ridiculous. 3 cracks in 3 years. My warranty ends in January next year. I don't have the money to spent on replacement every time this happens after my warranty expires.
    So I would like to know what can Apple do for a loyal fan like me?
    I really don’t want the cracking to keep happening, since I don’t have the money to keep repairing it.
    Regards,
    Dorothea

    As Templeton said, you will not get a response from Apple here. We're all just fellow users.
    I'd suggest calling Apple tech support and asking to speak with Customer Relations. When you get a CR representative on the line, calmly explain the situation and express your concerns about yet another case failure should they just replace the case yet again. I can't make any sort of promises - again, I don't work for Apple so I can't speak for them - but the CR representative may be able to work out something, ideally a replacement of the unit with a new model of MacBook.
    Good luck.

  • [DW CC] Regular Expression and Back Reference in "Replace with": Escape

    I have a problem with escaping a character in "Replace with".
    Let's assume the following situation:
    Content:
    foobar
    Search for:
    (foo)(bar)
    Replace by:
    $1zot$2
    Result:
    foozotbar
    Everything is fine.
    But I want to insert the number "2" in between foo and bar.
    When I use
    Replace by: $12$2
    The result is:
    $12$2
    It seems that the regex engine interpretes the "$12" as a whole. And because there's no back reference with the count "12" DW cannot work correctly.
    The question:
    How can I "escape" the "2"?
    Thanks.

    Dreamweaver uses JavaScript for its Find and Replace with regex.
    I've just checked the Regular Expressions Cookbook by Jan Goyvaerts and Steven Levithan (O'Reilly). It deals with exactly this sort of situation where capturing groups can be ambiguous. This is what it says:
    "Java and JavaScript try to be clever with $10 [and above]. If a capturing group with the two-digit number exists in your regular expresssion, both digits are used for the capturing group. If fewer capturing groups exist, only the first digit is used to reference the group, leaving the second as a literal. Thus $23 is the 23rd capturing group, if it exists. Otherwise, it is the second capturing group followed by a literal 3."
    In other words, there is no way to escape the 2 in the Replace field. It would appear there's a bug in Dreamweaver's use of capturing groups.

  • Can the keyboard be replaced with a backlit keyboard?

    I have a late 2010 MacBook Air with a plain keyboard.  Is it possible to have it replaced with a backlit keyboard?

    The logicboard on the 2010 MacBook Airs do not have the requisite electical connectors and controls for the support of the keyboard of the 2011 style. As well, the keyboard/keys itself are different and would not mate with the case.

  • [Perm] Find something, replace with nothing?

    I need to remove tags from a manuscript. In PageMaker I was able to search for:
    <A>
    and replace with:
    [nothing]
    This automated the process of deleting the extraneous text. However in InDesign, leaving the "Replace" field blank does not delete text. So there is seemingly no way to automated this deletion (in one step at least).
    Any suggestions would be appreciated.
    --Stephen

    Here you go. This script processes the selected story (either put your text cursor in the story or select one of its frames) and interprets PageMaker-like paragraph style tags.
    If you have no tags, the paragraphs will all be left with "No Paragraph Style" so don't run it against a previously processed story.
    If you don't tag a paragraph in the middle of the story, it will assume the style of the previous paragraph.
    The script creates styles on the fly if they don't already exist.
    If a paragraph starts with a "<" but has no ">" it's treated like a paragraph with no tag. Same for one that is tagged "<>".
    I've not exactly tested it thoroughly, but it looks as though it works.
    Warning: this version has a bug corrected two messages later.
    tell application "InDesign 2.0.1"
    set theStory to parent of selection
    if class of theStory is story then
      set theLim to count of paragraphs of theStory
      set theStyles to name of every paragraph style of document 1
      set curStyle to "[No paragraph style]"
      repeat with n from 1 to theLim
       set theChar to character 1 of paragraph n of theStory
       copy curStyle to theStyleName
       if theChar = "<" then
        set theText to contents of paragraph n of theStory
        set theOffset to (offset of ">" in theText)
        if theOffset > 2 then
         set theStyleName to characters 2 through (theOffset - 1) of theText as string
         if theStyleName is not in theStyles then
          tell document 1
           set newStyle to make paragraph style
          end tell
          set name of newStyle to theStyleName
          copy theStyleName to end of theStyles
         end if
         delete characters 1 through theOffset of paragraph n of theStory
        end if
       end if
       set applied paragraph style of paragraph n of theStory to paragraph style theStyleName of document 1
       copy theStyleName to curStyle
      end repeat
    end if
    end tell
    Dave

  • Since I had my iPhone 4 replaced with a refurbished model, does that extended my one year warranty?

    I bought an iPhone 4 last June and got it in July, but I had it replaced with a refurbished model a few months ago. Because of this, is the included one year warranty that I originally had extended by a period of time because I had this phone replaced?

    You get 90 days on the service replacement or you original warranty, whichever is longer, which I this case is the one on the replacement. So you are good for 90 more days.

Maybe you are looking for

  • Aperture wont open on 24" intel core 2 duo

    Have just recived my new imac and have successfully installed all my old software: CS1, Office etc. However when i installed my version 1 copy of aperture i managed to install it as always, yet when i come to open it up i get an error message saying

  • I live in Germany and in the USA. How can I use an itunes account for both shops ?

    Hi, I live half a year in Germany and half a year in California. How can I use my different Apple ID's to buy in Germany from the US-iTunes shop and in the U.S. from the German shop. Reason: the shops have different offers. Some booksare not availabl

  • Disk Utility - Disk Image Restore Failure

    Hi folks, when trying to restore a disk image I have had the error message: < Starting Restore… Could not establish communication with helper tool. Starting Restore… Parasite died Lost connection to helper tool> I have searched the discussions, apple

  • Captured NTSC video looks small in Canvas window

    Often, when we capture video into FCP (version 4.5), the clip comes in at 50% of it's original size (that's how it looks in the canvas window and on the NTSC monitor). We have looked at a number of sequence settings and have not been able to rectify

  • Viewing slideshow on TV

    Please please someone help me... I am a complete amateur and newbie to Keynote and have painstakingly created a slideshow for my sister's 40th birthday. It is fairly simple with transitions between slides, pictures/text and a soundtrack. All I want t