Learning..Simple variable as text in texteditor

I'm trying some basic things to learn. I just want the result from vari3 in the text document. But I get an apple event error.on this part 'set text 1 to vari3'
Please also give a bit advice... so I learn from it. many thanks.
I did try some changes but don't know what the best solution.
'set text 1 to "It works" Will work because that's plain text.
But getting the variable will not work for me.
set vari1 to 1 + 1
set vari2 to 1
set vari3 to vari1 + vari2
tell application "TextEdit"
activate
make new document at beginning
tell document 1
set text 1 to vari3
end tell
save the front document in ":Users:X:Desktop:testing.rtf" with replacing
close the front document
end tell
--------------------------------------------------

This is a strange issue of coercion.
TextEdit should be able to automatically coerce vari3 into a text object, but it fails for some reason. The solution is to be explicit.
Just change the line:
set text 1 to vari3
to:
set text 1 to vari3 as text
Off-hand, it isn't clear to me why this is necessary.

Similar Messages

  • HOW TO display a simple line of text if the user isn't logged in and not display it if they are?!?!?

    there must be a way to display a simple line of text (or a link) if the user isn't logged in (as wholesale customer), and not display it if they are?!?!?
    it's a basic kind of <php echo> var type of function.... there must be an equivalent in this BC system..... anyone?!?!?     PLEASE!
    thank you
    Chris.

    ok, after chattting with LIVE SUPPORT i've discovered {module_isloggedin}
    now i just need to integrate it into my Online Store modules!

  • Map simple variable to an abstract interface in BPM

    I'm using a Simple Variable to count all messages comming through a BPM.
    I want to use this Simple Variable's value in a Abstract Interface.
    Does anyone know how to map Simple Variables to Abstract Messages?
    A transformation needs a mapping, and a mapping cannot use a Simple Variable as input. The container operation need the same structure at both sides.
    Kind regards,
    Christiaan Schaake.

    Hi,
    Did you figure this out? If so, could you please share how you may have done this.
    Thx

  • Simple centering of text on page?

    I am new at using Buzzword, and am trying to center individual lines on a page of a new document I am typing.  How do I do this?  I see that on this screen for the creation of a new discussion topic on the forum, a quick and easy icon to click onto that centers text, but nowhere on my Buzzword document screen do I see such a icon, or reference to a drop-down file to "center."

    Thank you Michelle, very helpful!   One more question:  how do you close the toolbar (paragraph or otherwise) once it has been opened?  I assume that it automatically closes if a function is selected, but if this is not the case, I cannot find the way to close what has been opened!
    Date: Wed, 10 Feb 2010 17:05:31 -0700
    From: [email protected]
    To: [email protected]
    Subject: Simple centering of text on page?
    Hi,
    Thanks for your post. The center text option is somewhat hidden - it's on the Paragraph toolbar (not the default Font toolbar). To select the Paragraph toolbar, choose the small orange paragraph symbol on the far right of the screen. It will open and slide over to the left, then you will see the text - alignment options.
    http://forums.adobe.com/servlet/JiveServlet/showImage/19820/center_text.jpg
    Hope this helps!
    Let me know if you have additional questions as you get used to Buzzword.
    Best,
    Michelle
    >

  • Static text | variable | static text

    i'm thinking i need a simple actionscript to do this but i'm
    not exactly sure. i have a dynamic text field that is loading a
    variable named count. however i would like to place static text on
    either side of the value of the variable. since the variable is an
    integer that will only increase, it's horizontal width will also
    increase as well. i can't very well place two strings of static
    text on either side of a variable that will grow in width over
    time. does that make sense?
    essentially, i want to have a dynamic text box display a
    string of text, then the value of a variable (that will change in
    length), then another string of text, but i would like it to all be
    seamless, looking as if i just typed the whole sentence in a word
    processor. thanks for your time!

    let say you have a dynamic text field with instance name
    my_txt
    when you want to increase the value, you run my_txt.text++;
    when you want to decrease the value, you run my_txt.text--;
    now, convert the dynamic text field to a movieclip symbol,
    set the instance name my_mc
    now, to set the value of text, we should use
    my_mc.my_txt.text++;
    but we are not going to set the value in this way.
    now, go into my_mc movieclip, select the 1st frame, attach
    script:
    var actualValue:Number = Number(this.my_txt.text);
    var displayValue:String = "";
    function setValue(d) {
    actualValue += d;
    displayValue = "something"+actualValue+"something";
    my_txt.text = displayValue;
    setValue(0);
    go back to your maim timeline. and now,
    when you want to increase the value, use my_mc.setValue(1);
    when you want to increase the value, use my_mc.setValue(-1);

  • (Bash) How to set a variable with text from a file? [SOLVED]

    I'm having a little problem.
    I have textfile with a single line of text. What I want to do is set a variable with that line of text. How do I go about doing that?
    A simple var="text" wont work in this case, since the text in the file changes with another script of mine.
    Thanks in advance.
    Last edited by Aziere (2007-03-27 09:07:03)

    if you have a file with more than one line but you only want the first line you could use 'head'
    VAR=`head -n 1 file`
    Last edited by SiD (2007-03-27 05:58:33)

  • Using alerts with variables-"dynamic text" not working

    Hello all,
    I'm triggering an alert from a BPM, and have set the flag "dynamic text" on for the alert category associated with it. I'm doing it in a similar way to the blog 1382 by Michal:
    [/people/michal.krawczyk2/blog/2005/03/13/alerts-with-variables-from-the-messages-payload-xi--updated|/people/michal.krawczyk2/blog/2005/03/13/alerts-with-variables-from-the-messages-payload-xi--updated]
    The only difference is that I'm just assigning a fixed text instead of a payload element to the container element, which I've defined as simple type - string.
    However, the text of the alert doesn't show anything. I'm getting an email with just "Process <id>" as the subject and "Alert ID: <number>" in the body of the email (the same in the Alert Inbox).
    I'm starting to think that there could be something wrong in PI 7.1 which I'm using, as I've configured other alerts in scenarios without BPM without problem.
    Thanks for your suggestions!

    I've solved it using an alert from the Enterprise Services Builder (Integration Repository). It's a new feature in PI 7.1. It seems the tab "Container" in the alert category didn't exist before (that's why you don't find it in the weblogs of Michal and others) and now you have to use it.

  • Creating Variables From Text File

    Hello a little new to powershell and have banging my head on the wall trying to get this working.
    I have a text file (where the numbers of lines will change everytime) that will contain AD groups. 
    Lets say it looks like this
    GroupA
    GroupB
    GroupC
    I'm trying to you a loop that will read the file and output each new line to a variable so
    var1=GroupA
    Var2 =GroupB
    Var3=Groupc
    My first problem is that non of these can be null since this will be then be used with Add-ADgroupmemeber
    So I have it get the number of items with $Items = get-content *File* | Measure-Object -Line
    After that I have been trying to use a loop which to me looks like it should work however is not. I'm not getting any errors. However I'm not getting any created variables either. 
    For ($i=1; $i -lt $Items.lines; $i++) {
    $var[$i] = (Get-Content *File*)[$i-1]
    write-host $var[$i]}
    In my head I should get a listed of each line of the txt file but I'm getting nothing. 
    In the end I was hoping to doing something along the lines of ADD-Adgroupmember -identity $Var[$i] -members *Machine Name*
    If there is a better way to approach this I'm all ears.
    Thanks for any help!

    You don't need a loop to read each line from the file. You don't need a variable for each group read from the file. 
    For example, if your file looks like:
    GroupA
    GroupB
    GroupC
    with spaces/empty lines in it, that you wish to ignore, you can use:
    $Groups = Get-Content .\groups2.txt | % { ($_.split(" ",[System.StringSplitOptions]::RemoveEmptyEntries)) }
    The $Groups variable will be an array that holds non-empty lines from the file. You can use that directly as in:
    foreach ($Group in (Get-Content .\groups2.txt | % { ($_.split(" ",[System.StringSplitOptions]::RemoveEmptyEntries)) })) {
    Add-ADGroupMember -identity $Group -members *Machine Name*
    Sam Boutros, Senior Consultant, Software Logic, KOP, PA http://superwidgets.wordpress.com (Please take a moment to Vote as Helpful and/or Mark as Answer, where applicable) _________________________________________________________________________________
    Powershell: Learn it before it's an emergency http://technet.microsoft.com/en-us/scriptcenter/powershell.aspx http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx

  • Simple question around text box action listeners....

    Hi, I'm hoping there is a simple solution to this question.
    What I have is a text box, by default it will be empty. what I'm looking for is Some kind of action listener to be kicked off when ever a user writes in the textbox......
    here is a little bit of code i'd "like" to do....
       textBoxBean.addPropertyChangeListener(new PropertyChangeListener() {
                public void propertyChanged(PropertyChangeEvent event)
                     if (businessTypeBean.getText() != null){
                         // do somthing
                     else{
                         // do something else
            }); The only problem is the the silly thing never gets called.....
    a silly question but, unfortunatly all this is change a tooltip and enable disable a button based on weather or not there is something in the textbox....... Sigh......
    Any ideas would be great.
    Cheers,

    But you do waste your time with the above.......... With the hope that you will actually learn how to ask a meaningfull question the next time.
    You still have people totally confused about what you are asking. Some people think you have an AWT based question. Others think its a Swing related question.
    Your question is about an ActionListener, but you code shows a PropertyChangeListener. It seems like you are asking about a Swing component, but there is a Swing forum for Swing related questions.
    We are not mind readers. Ask a well thought out question and you will generally get a well though out response.

  • Photoshop color variables or text heading styles? are they possible?

    I am desigining a template which I would like to make in 15-20 different colors. Is there a way to set a color as a variable say "color1" and then set color1 equal to some value, say "#334f74" and then any instance of "color1" would be updated when I changed the value. For example if I have 10 layers each with a color overlay in the blending options they would all be updated to match the new color.
    Also, is there some sort of photoshop "heading" system similar to Word, where I can select font size color, aliasing, weight, spacing, etc and save it as a "heading", then assign that heading to my text boxes? So if I change the "heading" then anything using that heading type would be updated.
    This all seems like it should be basic functionality for a professional tool like photoshop, but I have been playing around with the variable settings and whatnot and cannot figure it out.
    Thanks!

    Mylenium is right.
    Not only is Photoshop an image editor, it is already bloated with additional features that are not needed if somebody has the correct application for the job.
    We don't need more features, we need improvements on problem areas!

  • Looking for a simple voice to text app

    I am looking for a simple app that will recognize my contacts and create voice to text messages. What is the best? Thanks for your help!

    Thanks, this app is simple and it works well. It has good voice recognition.

  • Variable in Text Caption in Html5

    I am trying to display the contents of a variable on a slide so I am using a text caption.  It works fine on my PC, but on the iPad, where it is using Html5, only the initial value of the variable is being displayed. I've tried delaying when the caption shows up to give it time to pick up the variable but to no avail.
    Failing this, is there some other way I can get the information in the variable out of Captivate 8, e.g. to email it or some such?
    Thanks.

    Could you try this: insert the variable in a text container on the first slide where it will be updated, and time this container for the rest of the project. Just to check if it never shows up on iPad?
    You say that you see a difference between Preview in Browser as SWF and as HTML5? Did you try the HTML5 version on anything else than the iPad?

  • Presentation Variable in Text field

    Hi, I am trying to pass the text field parameter to Analysis from Dashboard Prompt.
    I can pass the selected value of check box, list item but value that I put into the text field.
    any idea how to do it?..
    Thanks.~

    Ok. here is what I found.
    if It's Column Value when I set up at the Dashboard prompt, I can use Analyze. But when you use in Convert this to SQL to set the filter, IT WON"T WORK.
    if you use Variable Value , it won't work at all.
    What I was trying to do was using Variable Value to use less Textfield to search on different Columns.. it looks not working at all~..

  • Variable for texts in selection not unique

    Hi Guys,
    i have a query with a test variable in place in a selection restricted to 0Fiscper3. It worked before upgrade to netweaver 7.3. Now when i open workbook the text variable cannot be replaced.The error:Text variable ZCS_RV_T_PERIOD, which is found in the item "", needs to be replaced by the value of the characteristic 0FISCPER3. This value is not clearly specified in the item "". Therefore, no replacement takes place.
    What can i do Does anybody an idea.Did the usage change in BW7.3.
    Thanks and regards,
    Murat

    Hi,
    If I am right and the description is as above then
    in the query you are trying to replace the text variable ZCS_RV_T_PERIOD
    and it should be replaced by characteristic value. The same
    characteristic if it is also used in the selections with another values
    makes no sense for OLAP processor to replace this. If you have
    other selections which are done from 0FISCPER3,this will be the
    same characteristic for which the text variable ZCS_RV_T_PERIOD should
    be replaced.
    The OLAP processor makes the replacement of such kind of
    variables in context sensitive way. That means if you have another
    values for this characteristic (use another variable with shifts) then
    your selections are intend to return data for another characteristic
    value that should be replaced. And this is not possible.
    As a solution I would suggest to use another text variable which
    should be filled not by characteristic value, but variables with
    Customer exit or SAP exit. These types of variables will be replaced
    in all cases.
    Thanks,
    Venkat

  • Simple Variables example

    Hello,
    I have user rights to an Oracle 10g database but am not a DBA, so I do not have any editing permissions that I am aware of. I just use the database for queries.
    I want to understand how to use PL/SQL to enter variables but am struggling to find some simple examples of this?
    I am using Oradev Studio to run my SQL and have tried the following:
    declare
    v_dealname global_sf.deal.deal_legal_name %type;
    begin
    select
    deal_legal_name into v_dealname
    from
    global_sf.deal
    where
    deal_id = '87148804';
    dbms_output.put_line('Name: '||v_dealname);
    end;
    which I hashed together from here;
    http://www.dba-oracle.com/t_pl_sql_plsql_select_into_clause.htm
    Strangely the output section of OraDev is actually giving me this encouraging message "SQL6.sql: Execute succeeded [0.095 s]" but it is not giving me a printout of the variable as I was hoping. Is there an 'Immediate Window' or equivalent that I haven't found? Did the query actually work?
    I also tried to put a variable into the where clause in another arbitrary query:
    declare
    v_dealid INTEGER(8);
    begin
    v_dealid := 87148804;
    select
    creation_dt
    ,deal_legal_name
    ,actual_maturity_dt
    from
    global_sf.deal
    where
    deal_id
    =
    v_dealid;
    end;
    Here I am getting the error 'an INTO clause is expected in this SELECT statement'.
    Could anyone please advise me on some of these basic variables issues? Ideally a coulpe of simple examples I could use that don't require admin rights would be fantastic. It would be much appreciated.
    Thanks
    Jon
    Edited by: berlinhammer on 24-Aug-2010 04:48

    Running a debug session requires the DEBUG CONNECT SESSION system privilege, which isn't granted to PUBLIC by default, so you'll have to request it from your DBA if you want to use that (useful) facility. However it's not needed for just executing a PL/SQL block.
    Regarding enabling DBMS_OUTPUT in OraDev, the page you linked to looks more like some general background about the dbms_output package rather than a help page for the OraDev application itself. There must be a button or a preference setting somewhere. Doesn't it have a help menu? I've never heard of it I'm afraid. You don't need any special privileges to use DBMS_OUTPUT.
    Your first example looks fine, i.e:
    DECLARE
       v_dealname global_sf.deal.deal_legal_name %TYPE;
    BEGIN
       SELECT deal_legal_name INTO v_dealname
       FROM   global_sf.deal
       WHERE  deal_id = '87148804';
       dbms_output.put_line('Name: ' || v_dealname);
    END;The second one is missing an INTO clause (similar to the one in the first example), e.g. something like (untested):
    DECLARE
       v_dealid INTEGER(8) := 87148804;
       v_creation_dt         global_sf.deal.creation_dt%TYPE;
       v_deal_legal_name     global_sf.deal.deal_legal_name%TYPE
       v_actual_maturity_dt  global_sf.deal.actual_maturity_dt%TYPE;
    BEGIN
       SELECT creation_dt, deal_legal_name, actual_maturity_dt
       INTO   v_creation_dt, v_deal_legal_name, v_actual_maturity_dt
       FROM   global_sf.deal
       WHERE  deal_id = v_dealid;
       DBMS_OUTPUT.PUT_LINE
       ( 'creation_dt: ' || v_creation_dt ||
       ', deal_legal_name: ' || v_deal_legal_name ||
       ', actual_maturity_dt: ' || v_actual_maturity_dt );
    END;(You wouldn't normally hardcode the schema name in production code, as either you would own the tables or there would be synonyms in place.)
    However as Frank mentioned, that expects exactly one row to exist (no rows means a NO_DATA_FOUND exception, more than one will give a TOO_MANY_ROWS exception), hence the loop example.
    Edited by: William Robertson on Aug 24, 2010 6:53 PM

Maybe you are looking for

  • [Solved] xf86-video-ati low fps under normal user, fine under root

    Hi again. someone must had played HL1. So did I, but I had to run it under root to get the sufficient performance. I tried both OpenGL and DirectX drivers. At 640x480 the FPS is ~5. At 1024x768 it's "1". after some digging I found that glxinfo produc

  • How to reinstall mail and restore preferences

    Mail is going crazy on my MBP and MP. I am on IMAP and the spam functions on both my mac won't work. I have tried a restore and nothing will change. I have some rules and preferences that I would like to keep. How do I uninstall mail and do a clean r

  • Lightroom 3- How do I batch process a group of photos with the same preset?

    Using Lightroom 3/Mac.  Attempting to apply a preset to a group of photos. I read the forum already but what I read didn't make sense to me. Sorry. Also wondering if anyone else is plagued by Lightroom's tendency to take over the monitor. Whenever I

  • Quality Inspection and COA for 3rd Party Drop Ship Vendor

    The scenario is as follows: We will be using a 3rd party vendor to fulfill certain materials directly to our customers. The vendor will be sending us a sample from each production run to run our own analysis  against the batch. I am wondering the bes

  • Can't open itunes anylonger since last update ..

    it just opens a window saying that itunes is either on a HDD where I don't have access (as admin!!) or I don't have writing issues for the folder ...what to do? I tried uninstall, re install, removing Bonjour, installing an older version and so on ..