Variable name, how to?

Hi, is there a way in applescript to read a textfile with one word (es. a serial number) and set it as variable inside the script?
I need to upload a file on my ftp, and I'm using the "curl -u" command.
So I have something like this:
"curl -u mysitename:mypassword -T /Users/myname/Desktop/filetoupload.txt ftp://ftp.mysitename/SerialNumberAlwaysDifferent/"
so, as you get, I'm trying have the applescript dinamically change "SerialNumberAlwaysDifferent" with the string it fetches from a txt.
Any tips?
Thanks!

Use a construction like the following - ampersands are string concatenators, so you can slip the variable text into the string:
set serialNumberVariable to read "/path/to/text file.txt"
do shell script "curl -u mysitename:mypassword -T /Users/myname/Desktop/filetoupload.txt ftp://ftp.mysitename/" & serialNumberVariable & "/"

Similar Messages

  • Adding a vraible to a variable name - how do I do it?

    I have the following code:
    Can the following code:
    globals.data.goal = globals.data.player1/5
    be converted to something like:
    globals.data.goal = globals.data.player(globals.data.clk)/5
    I want to replace the "1" with the variable globals.data.clk
    Cheers
    Shaun

    I think wghat you're looking for is...
    globals.data.goal = globals.data["player"+String(globals.data.clk)]/5;

  • How to declare internal table in BADI with variable name beginning with 0..

    Gurus,
    How to declare an internal table within a BADI. I have to implement a BADI UC_TASK_CUSTOM for BCS to BW load and there i have to  declare an internal table like:
    TYPES:          BEGIN OF t_cube_data,
                    0cs_version       TYPE /bi0/oics_version,
                    0sem_cgcomp       TYPE /bi0/oisem_cgcomp,
                    bcs_vers          TYPE /bic/oibcs_vers,
                    bcs_lcus          TYPE /bic/oibcs_lcus,
                    bcs_ldch          TYPE /bic/oibcs_ldch,
                    bcs_invcom       TYPE /bi0/oibcs_invcom,
                    bcs_litem         TYPE /bic/oibcs_litem,
                    bcs_llob          TYPE /bic/oibcs_llob,
                    bcs_lmay          TYPE /bic/oibcs_lmay,
                    0move_type        TYPE /bi0/oimove_type,
                    pcompany         TYPE /bi0/oipcompany,
                    bcs_lprg          TYPE /bic/oibcs_lprg,
                    figlxref3         TYPE /bic/oifiglxref3,
                    fiscyear         TYPE /bi0/oifiscyear,
                    fiscper3         TYPE /bi0/oifiscper3,
                    fiscvarnt        TYPE /bi0/oifiscvarnt,
                    curkey_gc        TYPE /bi0/oicurkey_gc,
                    unit             TYPE /bi0/oiunit,
                    cs_trn_gc        TYPE /bi0/oics_trn_gc,
                    cs_trn_qty       TYPE /bi0/oics_trn_qty,
              END OF t_cube_data
    But with this declaration it gives a error saying that u cannot have a variable beginning with 0...like 0cs_version....
    but i have to do it for my functionality to wrk...
    Please help me do it....
    how can i declare a internal table that allows me to have variable names that start with 0....
    Please help....Its URGENT....
    Thanks
    Sam

    Murali,
    I need to have 0 before the variable name in the declaration of the internal table....how can i attain that....
    Please suggest...
    Thanks
    Sam

  • Unable to publish in Swf format. Get error message: 'Swf compilation failed. Note: Please verify if any of the actionscript keywords is used as user variable name'. Anyone know how to fix?

    Unable to publish in Swf format. Get error message reads: 'Swf compilation failed. Note: Please verify if any of the actionscript keywords is used as user variable name'. Anyone know how to fix?

    Hi There,
    Can you tell me the Operating System and Captivate version you are using?
    Also can you confirm if you are getting this issue will this one project or all the projects? Try to copy paste this project on a new blank project and then try to publish.
    Regards,
    Mayank

  • How do I create a variable name on the fly?

    Hi,
    If I have a String containing a value, how do I create a variable name using that value during program execution? That is if I have
    String fred = "newvar";
    How do I then create a new String with the name "newvar" (using the contents of fred)? I will never know what the content of fred is until this point. What I'd like to be able to do is something like
    String fred.subString(0) = "a new value";
    Obviously this won't work but if it did the statement would evaluate to something like
    String newvar = "a new value";
    Appreciate any help you can give,
    Dave.

    Here u go:
       private JCheckBox AddCheckBox( String strText, int nTextID )
          JCheckBox checkbox = null;
          Class checkboxDefinition;
          Class[] stringArgsClass = new Class[] {String.class};
          Constructor stringArgsConstructor;
          Object[] stringArgs = null;
          String arg = "";
          arg = "CheckBox" + nTextID;
          String label = new String(arg);
          stringArgs = new Object[] {label};
          try
            checkboxDefinition = Class.forName("javax.swing.JCheckBox");
            stringArgsConstructor = checkboxDefinition.getConstructor(stringArgsClass);
            checkbox = (JCheckBox) createObject(stringArgsConstructor, stringArgs);
            checkbox.setName(label);
            checkbox.setText(strText);
            checkbox.setSize(new java.awt.Dimension(CQuestionBase.PAGEWIDTH, 21));
            checkbox.putClientProperty("1",new Integer(nTextID));
            checkbox.setVisible(true);
          catch (ClassNotFoundException e)
            System.out.println(e);
          catch (NoSuchMethodException e)
            System.out.println(e);
          return checkbox;
       }This code was based on an example I found about two years ago. You can use the same methodolgy to create objects of any kind. Again, look at java.lang.Reflect.

  • Added dynamic text; How do I stop variable name from showing?

    I am creating a simple game for kids.  On the first page, I added an "input text" field for their first name.  I called the variable firstname.
    When they move to the next page, I used a "dyanamic text" field so I can call them by name on this page.  It works.  However, When I test the game, on the first page, where the firstname is input, it shows    _level0.firstname          instead of just a blank space for them to input their name.
    I know I fixed this in the past and it was something simple, but I can't remember how to do it.  I'd appreciate anyone's help!
    Thanks.

    Beginning with Flash MX (version 6), you assign the text field an instance name using the Property inspector. Although you can use the variable name method with dynamic text fields for backwards compatibility to Flash 5 and earlier versions, Macromedia doesn't recommend this, because you can't control other text field properties, or apply style sheet settings

  • How to get Variable name in output (Report Writer/Painter)

    Hello Experts,
    We have maintained one Repot by using Report Writer, this is the report for Cost center (periodic report), input fields are Fiscal year, Period and Cost Center. In out put system will display the selected cost center balances for individual cost element.
    Output: Excel format: in first sheet it will display balance of the total cost centers selected and from second sheet it will display individual cost center balances.
    My requirement is in the output system is displaying sheet name as CC1,CC2,CC3.......CC50, but my user want to display this as Cost Center 1, Cost Center 2, Cost Center 3...... like this. we have maintained variable name as Cost center 1, cost center 2....., but why system is displaying as CC1,CC2,.... .
    Please help me how to get the full description as sheet name in excel.
    Thanks ......Sudheer

    Hello Everybody,
    Please help me how to get variable name in Report Painter outout ( Excel format ).
    Thanks

  • How to check Variable Names

    Hi All,
    I am checking in CMOD include.  It has lot of code. Example:  When 'ZFISPER' . I think that is Variable Technical name. How to check that variable and in Which Query it is.
    Please let me know...
    Thanks in advance..
    KN

    Hello,
    You can go over into transaction code RSA1 and then on your left hand side you will be able to see lot of tabs in terms of Modeling, Administration, Transport Connection and so on.
    So go ahead and click on the tab "Transport Connection" and in the next screen you will be able to see all object types available in your environment.
    Please go ahead and open up the section "Query Elements", if you are not able to see the same, on the left under the transport connection you will see the folder "SAP Transport" and within that the option called "Object Types", just click on it once and all the object types which are available for transports will show up.
    Once you have selected Query Elements, under that you will be able to see different Query related objects and you will be having "Variable". When you drilldown on Variable folder you can double click "Select Objects" and select your appropriate variable name.
    One other way to proactively get a list of variables available in your system and to find out on which InfoObject they have been buill, please go into transaction se16 or se12 and then enter the table name RSZGLOBV.
    In this table you can get a list of all the variables along with the metadata without trying to parse through one by one variable.
    Thanks
    Dharma.

  • How to find Query name using Variable name (by Customer exit code in CMOD).

    Dear SDN,
    Enhancement name RSR00001.....Function Module name.....EXIT_SAPLRRSO_001...Include ZXRSRU01...
    Some x variable coding in done here.
    How can I find out the Query name for the X variable?
    Wating for reply...
    Thanks & Regards,
    Praveen.K

    Dear,
    I have got answer..
    Method 1 :Right click on variable in Query Designer and find the where used list.
    Method 2 : SE16--> RSZGLOBV -->Enter the variable VNAM as 'Variable Name' ->Get the VARUNIID> Go to table RSZELTXREF --> Enter the values of VARUNIID in TELTUID --> Get the list of SELTUID --> Go to table RSZCOMPDIR --> Enter the values of SELTUID in COMPUID --> Get the list of COMPID -->COMPID is the list of queries
    Thanks & Regards,
    Praveen.K

  • How to auto create a global variable with specific variable name in a global vi ?

    how to auto create a global variable with specific variable name in a global vi using lv ? Because i need to add a lot of global variable in this global vi. But you know, if  i manually add them , it will be a much time-costing work. So i want to use someway to auto generate ? Can i ?? Thanks a lot !

    Hi
    what aartjan is saying is the way for you. but you can develop an utility which will actually help you create global variables. To get the details on this just have a look at VI Scripting section on LAVA forum.
    But i would like you to suggest few things
    1. If your programs have so many global variables (Thats why u want utility) then you should take out some time to read about LabVIEW design patterns. I think if programmer follows these practicess he dont need a single global variable.
    2. Their are some other ways to achieve similar functionality as of global variables (Uninitialized Shift Registers, Single Element Qs and so on) but they are much faster than global variables.
    I am Attaching Whatever Resources i am having I will also attach the template of the design pattern i generaly use in short duration
    Message Edited by Tushar Jambhekar on 10-06-2005 07:33 PM
    Message Edited by Tushar Jambhekar on 10-06-2005 07:36 PM
    Tushar Jambhekar
    [email protected]
    Jambhekar Automation Solutions
    LabVIEW Consultancy, LabVIEW Training
    Rent a LabVIEW Developer, My Blog
    Attachments:
    LabVIEWDesignPatterns.zip ‏1505 KB
    Large_Code_Implementation.zip ‏522 KB
    Database Tests.zip ‏868 KB

  • How to Search for Variable Name in an Apex Page

    Hi,
    Whenever I am writing code and I need to remove a reference to a variable name, I just to a search and replace on the source.
    With Apex, is there a way to do that on the Apex page definition? I have click on every validation, process, report to comb each region for the variable reference. Thanks.

    Hi Samuel,
    Have a look at the APEX views ( Utilities > APEX Views ).
    You can select most (all?) of the information associated with a page and then search the result set(s) for the variables you are looking for.
    I hope this helps.
    Cheers,
    Patrick Cimolini

  • How to use an array for variable name of swing components using NetBeans

    I'm completely new to Java and GUIs, so excuse me if I use the wrong terminology. I'm making a JFrameFrom in NetBeans. I'm getting really tired of typing instructions like jTextField15.setText(variable[15].text); I would like to make the variable names of my text fields an array so I can use a loop to change the values, text, tooltips, etc. When I click "change variable name" it won't let me put an array in. The code that Swing generates is protected and I can't change it. I know there must be a way to do this. Any help is appreciated.

    Try not to use the NetBeans visual GUI builder. Then it should be easy to create an array of text fields:
    JTextField[] tfs = new JTextField[15];
    for (int i = 0; i < tfs.length; i++) {
        tfs[i] = new JTextField(10);
    }For laying out the text fields, see: [http://download.oracle.com/javase/tutorial/uiswing/layout/using.html]

  • How to change dinamically variable name?

    Is it possible to change variable name dinamically into loop?
    loop at itab.
    move itab-item to field_x.
    endloop.
    I would copy my itab-item into field_1, field_2......field_x at each loop.
    Thanks
    Alfonso.

    You have to use the field symbol for the field giornoX not for the structure
    DATA: BEGIN OF wa_alv OCCURS 0,
            pernr            LIKE pa0001-pernr,
            persk            LIKE pa0001-persk,
            des_grado_abbrev LIKE zhr_descr_grado-des_grado_abbrev,
            vorna            LIKE pa0002-vorna,
            nachn            LIKE pa0002-nachn,
            giorno1          TYPE char12,
            giorno2          TYPE char12,
            giorno3          TYPE char12,
            giorno4          TYPE char12,
            giorno5          TYPE char12,
            giorno6          TYPE char12,
            giorno7          TYPE char12,
          END OF wa_alv.
    data tb_alv like table of wa_alv.
    field-symbols: <giorno> type any.
    data: name_giorno(13).
    LOOP AT tb_alv ASSIGNING wa_alv
      LOOP AT tb_orario.
       do 7 times.
        concatenate 'wa_alv-giorno'  sy-index into name_giorno.
         assign (name_giorno) to <giorno>.
         giorno  = tb_orario-orario.
        enddo.
        ENDLOOP.
    ENDLOOP.
    bye
    enzo

  • How to know the nos. and variable name from Jframe ?

    Hello Everyone,
    I have just started java programming. I have one form (using jframe) and there are nos. of components like text field, radio buttons, list box, buttons etc.).
    I want to know nos. and type of components (text field, radio buttons, button etc..) and variable name of these components ?
    Is there any way class / method or technique for the same ?
    With Thanks !
    Prashant Shukla

    Since if you are dealing strictly swing here, and no mixed in awt, all you have is JComponents, then where's the problem ... why do you even need to know which JComponent it is?
    This what you have?
    class StuffWithListeners  extends JFrame  implements ActionListener, KeyListener {
      StuffWithListeners() {
        jb = new JButton("GO");
        ta = new JTextArea(10,20);
        jb.addActionListener(this);
        ta.addKeyListener(this);
      public void actionPerformed(ActionEvent ae) {
      public void KeyPressed(KeyEvent ke) {
    }Edited by: abillconsl on Dec 14, 2007 5:23 PM
    null

  • How to build a connection string if "Only variable names (i.e.: $variable) may be used as the target of an assignment statement."

    im looping through databases on a server & building  a connection string to each database.
    $SQLConn.ConnectionString = "Server=$SrvName; Database=$DBName; User ID =DBLogin; Password=myPassword;"
    The problem is i get this error:
    Only variable names (i.e.: $variable) may be used as the target of an assignment statement
    I can put the code into an Inlinescript, but then I lose the ability to perform paralellism. Is there any way to construct the connection string in PS Workflow without using an Inlinescript?

    Hi Winston,
    Why not just wrap the InlineScript blocks in a Parallel block, to cause them to execute in parallel?
    For example:
    workflow foo {
    parallel {
    inlinescript {
    start-sleep -Seconds (Get-Random -Minimum 1 -maximum 5)
    "a"
    inlinescript {
    start-sleep -Seconds (Get-Random -Minimum 1 -maximum 5)
    "b"
    Sometimes outputs "a b" and sometimes outputs "b a"

Maybe you are looking for