JS - surrounding selected text with double quotes

I have a working script which places brackets around selected text in the main body of my document (not in a table), but when I changed the script to insert double curly quotes, the script wont work.
Why wont this JS work (script stalls on the var line):
var myObject = (app.selection[0].parent.constructor.name == "Cell") ? app.selection[0].parent.texts[0] : app.selection[0];
with (myObject)
insertionPoints[-1].contents = "";
insertionPoints[0].contents = "";
while this one does work:
var myObject = (app.selection[0].parent.constructor.name == "Cell") ? app.selection[0].parent.texts[0] : app.selection[0];
with (myObject)
insertionPoints[-1].contents = ")";
insertionPoints[0].contents = "(";
Thx Oz
PS The quotes are showing as three straight quotes above, but in my script they are two straight double quotes surrounding either a right or a left curly double quote.

Perhaps there's a Smart Quotes interpreter in JS? Who knows.
If you find it failing again, try inserting the quotes as Unicode values, as these should not be subject to any translating.
I.e.,
>insertionPoints[-1].contents = "\u201c";

Similar Messages

  • How to replace single quote with double quote

    hai all,
    i have a problem,
    i am trying insert a string containing single quote into ms-access database.
    it is giving error.
    how can i avoid this .if i replace a single quote in the text with double quote it will defenitely
    insert into database.
    in java.lang.String
    replace () will not work to replace quote with double quote.
    any otherway to solve this problem.
    please mail me to [email protected]
    thank you
    sambareddy
    inida

    java.lang.String.replace () will not work to replace quote with double quote.Really?
    String x = ...
    x.replace( "'", "\"" );

  • SSIS importing comma delimited with double quote text qualifier - Works in VS - SQL Job ignores text qualifier and fails (truncation)

    I've created an SSIS package to import a comma delimited file (csv) with double quotes for a text qualifier ("). Some of the fields contain the delimiter inside the qualified text. An example row is:
    15,"Doe, John",IS2,Alabama
    In SSIS I've specified the text qualifier as ". The sample output in the connection manager looks great. The package runs perfectly from VS and when manually executed on the SSIS server itself. The problem comes when I schedule the package to run via SQL
    job. At this point the package ignores the text qualifier, and in doing so pushes half of a field into the next available column. But instead of having too many columns, it concatenates the last 2 columns ignoring the delimiter. For example (pipes are fields):
    15|"Doe| John"|IS2,Alabama
    So the failure happens when the last half of a field is too large to fit into the next available field. In the case above _John" is 6 characters where the IS2 field is char(3). This would cause a truncation failure, which is the error I receive from the
    job history.
    To further test this I created a failure flow in my data flow to capture the records failing to be pulled from the source csv. Out of ~5000 records, ~1200 are failing, and every one of the failures has a comma delimiter inside the quoted text with a 'split'
    length greater than the next ordinal field. The ones without the comma were inserted as normal and records where the split fit into the next ordinal column where also imported, with the last field being concatenated w/delimiter. Example records when selected
    from table:
    25|"Allan Percone Trucking"|GI6|California --Imported as intended
    36|"Renolds| J."|UI6,Colorado --Field position offset by 1 to right - Last field overloaded
    To further ensure this is the problem, I changed the csv file and flat file connection manager to pipe delimited, and sure enough every record makes it in perfectly from the SQL job execution.
    I've tried comma delimited on the following set ups. Each set up failed.
    SSIS Server 2008 R2 RTM
    DB Server 2008 RTM
    DB Compat 80
    SSIS Server 2008 R2 RTM
    DB Server 2008 R2 RTM
    DB Compat 80
    SSIS Server 2008 R2 RTM
    DB Server 2008 RTM
    DB Compat 100
    SSIS Server 2008 R2 RTM
    DB Server 2008 R2 RTM
    DB Compat 100
    Since a lot of our data comes in via comma delimited flat files, I really need a fix for this. If not I'll have to rebuild all my files when I import them to use pipe delimiters instaed of commas. I'd like to avoid the extra processing overhead if possible.
    Also, is this a known bug? If so can someone point me to the posting of said bug?
    Edit: I can't ask the vendor to change the format to pipe delimited because it comes from a federal government site.

    Just wanted to share my experience of this for anyone else since I wasted a morning on it today.
    I encountered the same problem where I could run the package fine on my machine but when I deployed to a server and ran the package via dtexec, the " delimeter was being replaced with _x0022_ and columns all slurped up together and overflowing columns/truncating
    data etc.
    Since I didn't want to manually hack the DTS XML and can't install updates, the solution I used was to set an expression on the textdelimiter field of the flat file connection with the value "\"" (a double quote). That way, even if the one stored in XML
    gets bodged somewhere along the way, it is overridden with the correct value at run time. The package works fine everywhere now.

  • Csv with double quotes

    Hello,
    I've had harsh time trying to figure out how to read a csv file with double quotes, I need to read a csv file in order to fill a spreadsheet.
    I attach a csv file example to show the sort of file I'm working on.
    Thank you
    Raymundo Cassani
    Solved!
    Go to Solution.
    Attachments:
    test_file.csv ‏1 KB

    Upon closer inspection, you are right, it was a trick question.  You need to look for commas that follow an even number of quotation marks for the separators.  Since my previous snippet was not converted, I assume you have an earlier LV version so I have attached an example in 8.6.  You can get rid of the quotes if you like (exercise for the reader).
    Attachments:
    ReadCSVwithQuotes.vi ‏9 KB

  • Update with double quotes

    Hi,
    How to include double quotes in a update statement?
    UPDATE sampletable
    SET description = '<p style="font-weight: bold; color:Red;"> Message to Employee </p>'
    WHERE empid = 1;
    Expected output with I query table,
    select description from sampletable WHERE empid = 1;
    <p style="font-weight: bold; color:Red;"> Error Message </p>
    Table definition:
    sampletable
    empid number
    description varchar2(200)
    Thanks

    Please use the {noformat}{noformat} tag at the beginning and end of your examples.SQL> create table sampletable( empid number, description varchar2(2000));
    Table created.
    SQL> insert into sampletable values (1, null);
    1 row created.
    SQL> UPDATE sampletable
    2 SET description = '<p style="font-weight: bold; color:Red;"> Message to Employee </p>'
    3 WHERE empid = 1;
    1 row updated.
    SQL> select * from sampletable;
    EMPID
    DESCRIPTION
    1
    <p style="font-weight: bold; color:Red;"> Message to Employee </p>
    Your question is not clear: why are you expecting "Error Message" instead of "Message to Employee"?
    What do the double quotes have to do with it?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • View Columns with Double Quotes

    When Creating a view I specify Column Names, but when you look at the SQL tab it puts double quotes around the columns is there a preference to turn this off? Is there a reason for it operating this way?
    CREATE OR REPLACE FORCE VIEW "MCT"."V_USER_ORGANIZATIONS" (CUSTOMERS_ID, CUSTOMER_NAME) AS
    SELECT Customers_ID, Customer_Name FROM mct.Customers
    UNION ALL
    SELECT Proc_Offices_ID *-1 as Customers_ID, Proc_Office_Name as Customer_Name FROM mct.proc_offices;
    becomes the following
    CREATE OR REPLACE FORCE VIEW "MCT"."V_USER_ORGANIZATIONS" ("CUSTOMERS_ID", "CUSTOMER_NAME") AS
    SELECT Customers_ID, Customer_Name FROM mct.Customers
    UNION ALL
    SELECT Proc_Offices_ID *-1 as Customers_ID, Proc_Office_Name as Customer_Name FROM mct.proc_offices;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    The only control we have over the DDL that is generated are the options in Tools > Preferences > Database > ObjectViewer Parameters, which doesn't include an option to exclude unnecessary double quotes.
    The reason why they are put in when generating the DDL is to simplify the logic of generating the DDL - if they were not there, it would be necessary to check if names were in mixed case or not. For example, it would be possible to create a view as follows:
    CREATE OR REPLACE FORCE VIEW "My_View" ("Customer_ID", "Customer_Name") AS ...
    With this, I have explicitly said that my view and column names are case sensitive - and this is NOT equivalent to:
    CREATE OR REPLACE FORCE VIEW MY_VIEW (CUSTOMER_ID, CUSTOMER_NAME) AS ...
    That being said, as I understand it, SQL Developer uses the DBMS_METADATA package to generate the DDL and the inclusion of the double quotes is presumably the standard option with that.
    theFurryOne

  • Scrolling and selecting text with a bluetooth mouse. (Possible bug?)

    I currently have an Apple Keyboard and Magic Mouse hooked up to my Playbook. They work very well, the implementation is incredible. However, I cannot for the life of me figure out how to scroll with the the mouse. It really limits the PB since if I hook it up to my television I cannot scroll unless I have the PB near me. Has anyone gotten this to work or is this something we are hoping to get in a future update? Aslo, is there a way to select text and bring up the copy/paste menu without having to use the touch screen? I can select text by holding shift / arrow keys on the keyboard but am unable to perform any actions without having to use the touchscreen.
    Thanks!

    Hold on there, @jnko -- are you saying you can scroll with the mouse (as in, use the virtual scroll wheel), or are you saying you can use the mouse to click on the document in, say, Word To Go, and drag it to make the screen scroll?  I can only do the latter, and, like you, can't scroll at all in the web browser.  Stinks that this wasn't fixed with the last update...

  • Trouble selecting text with touch up tool

    I have carefully followed the instructions step by step but I cannot get the touch up text tool to turn into an I-beam in order to select text for touching up the color.  I have tried with several documents with no luck, trashed the preferences to revert to the default status, closed and reopened acrobat. I've used this facility several times in the past to access the properties of the text in order to change its color, but I can't seem to do it now.
    I am using Acrobat 9 for mac on an imac (Intel core i3), currently Under OS10.7.3, but I had the same problem under OS 10.6.8.

    Are you looking at scanned text or real text. The inability to get an ibeam (it only comes on when you are over text) is an indication you are likely looking at a graphic. Try it on a file you know for sure is text and see if it works there.

  • Scrolling selected text with Indesign CS6 to show different font style

    Hi, I recently found I could highlight a paragraph and using font character style I could scroll through fonts changing whole paragraphs, I can't remember how I did this, I know it's a new feature with CC, I'm on CS6

    Select the text you want to change. Click your cursor after the font name in the field. Press the up or down arrows, and you can see the selected text change.

  • Incorrect SELECT statement with single quotes

    I am getting the following error trying to select a value from a database:
    SQLException caught: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'mod='Payroll''. Couldn't load driver:[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'mod='Payroll''.
    Here is the select statement code:
    PreparedStatement ps = con.prepareStatement("SELECT username FROM experts WHERE mod='"+mod+"'");
    I have tried all kinds of variations with the quotes, and single quotes but still get the same error...I know I'm on the right track but I can't seem to spot the error and was hoping someone else could??
    thanks in advance,
    chuk

    Hi,
    I tried that and now I get an even stranger syntax error which says "Syntax error (missing operator) in query expression 'mod=Pa_RaM000'."
    any ideas?

  • 8.1.7 jdbc driver: object types with double quotes

    Hi all,
    While switching from 8.1.6 to 8.1.7 I have trouble with the jdbc driver. It doesn't work
    as before: The function CallableStatement.registerOutParameter (and probably some other) doesn't take object type
    names in double quotes anymore. A test program is appended to this message. Using a 8.1.6 jdbc driver this program works fine but with a 8.1.7 jdbc driver it throws an exception.
    My questions are: Is this bug already filed?
    Is a bugfix already available somewhere?
    Thanks in advance for any information
    Joerg
    import java.sql.*;
    * create type "test_t" as object (atrb number(10));
    * create table "test" of "test_t" (atrb not null) oidindex();
    class test
    public static void main (String args [])
    throws SQLException
    String s = "begin insert into \"test\" t values (1)" +
    " returning ref(t) into ?; end;";
    try{
    DriverManager.registerDriver(new
    oracle.jdbc.driver.OracleDriver());
    Connection conn = DriverManager.getConnection
    ("jdbc:oracle:thin:@host:1521:orcl","joerg", "password");
    CallableStatement cs = conn.prepareCall( s );
    cs.registerOutParameter(1, Types.REF, "\"test_t\"");
    cs.execute();
    System.out.println("Statement returned:");
    System.out.println( cs.getObject(1) );
    cs.close();
    conn.commit();
    conn.close();
    catch(SQLException e){
    System.out.println("SQLException was thrown...");
    System.out.println(e.getMessage());
    }

    I believe that typenames are always treated as case sensitive (unless they are all uppercased).
    In your example you should write:
    cs.registerOutParameter(1, Types.REF, "test_t");
    If you had declared the type test_t in a case insensitive way (without "..."), then you'd have to write:
    cs.registerOutParameter(1, Types.REF, "TEST_T");
    If you have a schema-qualified name, use a ".":
    cs.registerOutParameter(1, Types.REF, "SCOTT.test_t");
    However, this behavior implies that you cannot use "." inside of quoted identifier names.

  • I can't select text with the mouse

    When I click anywhere in a text string the cursor automatically goes to the 'home' position. If I try to select text by scrolling across text with the mouse button down the cursor also returns to the 'home' position and no text is selected. Any ideas?

    Nee more info.
    Are you working with Flash Professional?
    Is thas an AS3 file?

  • How to search for the selected text with a non-default search engine?

    Hi,
    Before the recent update of the search bar, you could select your "current" search engine, and a search for the selected text (right-click on selection) would use that engine.
    Now, it seems that you can only search for the selected text using the default engine. If that's correct, this is a major step backwards for me. For instance, I can't have Google as my default search engine, and search for a selected text on eBay!
    Or am I missing something?
    Thanks!
    R.

    I find this extension very useful for items selected on web pages. It offers all your search engines with select>right click.
    https://addons.mozilla.org/en-US/firefox/addon/context-search/?src=search

  • Query filters with double quotes fail

    Hi,
    when I to execute a query with a filter that contains double quotes on
    Kodo 3.0.3 I get an Exception.
    Filter:
    string == \"My name is \"Wolfgang\".\"
    Kodo interprets the double quotes (after 'is ' )as the end of the string
    and expects the next token ('Wolfgang') to be an attribute name.
    Is there an escape character for double quotes or any other solution?
    Exception:
    kodo.util.UserException: Attempt to query nonexistant or unm
    anaged field "Wolfgang" of type "de.logas.datenbank.jdo.BeispielKlasse1".
    at kodo.query.FilterParser.traversePath(FilterParser.java:1061)
    at kodo.query.FilterParser.eval(FilterParser.java:783)
    at kodo.query.FilterParser.getValue(FilterParser.java:999)
    at kodo.query.FilterParser.eval(FilterParser.java:813)
    at kodo.query.FilterParser.getExpression(FilterParser.java:1021)
    at kodo.query.FilterParser.parseFilter(FilterParser.java:204)
    at
    kodo.query.JDOQLQuery$DataStoreQueryExecutor.<init>(JDOQLQuery.java:4
    27)
    at
    kodo.query.JDOQLQuery.newDataStoreQueryExecutor(JDOQLQuery.java:99)
    at kodo.query.AbstractQuery.internalCompile(AbstractQuery.java:576)
    at kodo.query.AbstractQuery.compile(AbstractQuery.java:531)
    at kodo.datacache.CacheAwareQuery.compile(CacheAwareQuery.java:271)
    -- Wolfgang

    Also, in general, it is advantageous to separate variable content in a
    query out into parameters. This helps us out when maintaining our query
    compilation cache.
    -Patrick
    Stephen Kim wrote:
    Wolfgang,
    To do this in JDO you have to double escape it
    i.e. string== \"My name is \\\"Wolfgang\\\".\"
    Wolfgang Hutya wrote:
    Hi,
    when I to execute a query with a filter that contains double quotes on
    Kodo 3.0.3 I get an Exception.
    Filter:
    string == \"My name is \"Wolfgang\".\"
    Kodo interprets the double quotes (after 'is ' )as the end of the string
    and expects the next token ('Wolfgang') to be an attribute name.
    Is there an escape character for double quotes or any other solution?
    Exception:
    kodo.util.UserException: Attempt to query nonexistant or unm
    anaged field "Wolfgang" of type "de.logas.datenbank.jdo.BeispielKlasse1".
    at kodo.query.FilterParser.traversePath(FilterParser.java:1061)
    at kodo.query.FilterParser.eval(FilterParser.java:783)
    at kodo.query.FilterParser.getValue(FilterParser.java:999)
    at kodo.query.FilterParser.eval(FilterParser.java:813)
    at kodo.query.FilterParser.getExpression(FilterParser.java:1021)
    at kodo.query.FilterParser.parseFilter(FilterParser.java:204)
    at
    kodo.query.JDOQLQuery$DataStoreQueryExecutor.<init>(JDOQLQuery.java:4
    27)
    at
    kodo.query.JDOQLQuery.newDataStoreQueryExecutor(JDOQLQuery.java:99)
    at
    kodo.query.AbstractQuery.internalCompile(AbstractQuery.java:576)
    at kodo.query.AbstractQuery.compile(AbstractQuery.java:531)
    at
    kodo.datacache.CacheAwareQuery.compile(CacheAwareQuery.java:271)
    -- Wolfgang

  • Selectable text with images scroller

    I've been looking everywhere to see if it is it possible to
    have images embedded within a selectable text scroller? I can do
    everything except embed images that will scroll with the text. So
    far, when I embed images, the text becomes static.
    Does anyone have a solution?
    MJ

    You should process the found instances back to front:
    for (i = f.length-1; i >= 0; i--)
    Peter

Maybe you are looking for

  • Best Buy is not a good business...

    I recently bought an iPad Air 2 from Apple.com, 3 days ago. I went into best buy to get a screen cover. The installer mishandled the new device and scratched it. I was a bit taken back, as I just bought this device for $700+ and took it in to be prot

  • Change active Partition in Solaris 10

    I have installed Solaris10 and after Windows Xp, the boot loader disappear. The system Startup always by Windows Xp. I have installed Partion manager and I change Active partition to Solaris 10, Know the system Statup always by Solaris 10. Please tel

  • How do I change the submit to email address?

    I have made a form in Adobe Acrobat X Pro, and initially I wanted the form to be sent to one email and I entered it in, but now that person is no longer accepting the forms and it needs to be routed back to me. Unfortunately, I cannot seem to figure

  • Only part of a song?

    My 60gb ipod will start playing a song and then skip onto another song at a random spot in it. The songs seem quite arbitrary as do the spots where they switch... for example I was able to play "Eriatarka" by The Mars Volta halfway through once befor

  • Account lock error when opmnctl start

    Hi After a longer time I tried to reboot my Portal 10. When running opmnctl startall, the service was hanging and only starting the following: ------------------------------------------------+--------- ias-component | process-type | pid | status ----