How do I create a variable in apple script?

I've overcome almost all of the obstacles I've had in setting up our new Apple network. The last step is seemingly simple -
I need to create a simple mount network drive script at login for each user.
Basically, the script calls to our AD server, and mounts the user's personal folder. This way no matter if they're on a mac or PC, they are saving to the same network space.
So what I need to do is get the username of the currently logged in person and have that name assigned to the end of the mount drive path
Ive found the whoami script to be useful for pulling the name of the current user.
Now I need to apply it to the path, for example:
if the user is Bob, his folder is at smb://server1/users/Bob
What I need to happen in the login script, is to be able to make the last part, "Bob" be changeable based on the currently logged in user
SO theoretically, smb://server1/users/& whoami     or at least the functionality similar to it, but I'm apparently missing something in the variable syntax.
Any help would be appreciated. Thanks!

Here:
"smb://server1/users/" & (do shell script "whoami")
(69091)

Similar Messages

  • How do I create a variable video delay of a live stream...

    I have a live video feed from my webcam in my Flash Application. I have a second video window next to it that I want to place a variable delayed video of the live stream. Therefore, I need to save the video stream in memory/disk and create this variable delay, say 5-60 seconds. As well as, continue to capture the live stream. The camera I am using suppots H.264 encoding.
    How do I create a variable length queue or buffer to hold the video stream coming into the flash application. Do I create a memory variable or write this to disk ? I have been looking over the ActionScript 3.0 documentation and I can not figure out how to code this either way ( as a memory variable or write to disk queue ).
    I want to be able to change the delay, view the delay stream in slow motion and scrub through the delayed stream.
    I would like to do this with out having to use Flash Media Server.
    Thanks,
    Bob

    I am sure it is practically impossible to accomplish that on the client side. Although theoretically it is conceivable to use NetStream.appendBytes() but it requires an extremely complex implementation.
    I suggest you look into FMS DVR capacities:
    http://help.adobe.com/en_US/flashmediaserver/devguide/WS236AE81A-5319-4327-9E44-310A93CA09 C6Dev.html

  • HOW TO CREATE A VARIABLE IN SAP SCRIPT

    HI ALL,
    CAN ANYONE TELL ME HOW TO CREATE A VARIABLE IN SAP SCRIPT.
    THANK YOU,
    BYE
    TAKE CARE.

    Hi Ravi,
    You can use like this
    A text in the editor contains the following DEFINE commands:
    /: DEFINE &mysymbol& = 'xxx xxx xxxxx xxxx'
    &mysymbol&
    /: DEFINE &mysymbol& = 'yyyyy yyy yyyy'
    / &mysymbol&
    The printed text appears

  • 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.

  • How can I create a variable size array?

    How can I create a variable size array?

    ok then how can i create a new vector object?If you don't know that, you need to go back to your text book and study some more. Or read the tutorial on the basics of Java: http://java.sun.com/docs/books/tutorial/java/index.html
    After reading that you can move on to: http://java.sun.com/docs/books/tutorial/collections/index.html
    Anyway, the answer to your question is, of course:
    Vector v = new Vector();(But you should probably use ArrayList instead of Vector.)

  • How do i create a password for apple tv? it doesn't accept my itunes password

    how do i create a password for apple tv? it doesn't accept my itunes password

    no to access itunes store you need the appleID and correct password
    but to access the internet you need the password for your wifi network

  • How can i create "bind variable"

    How can i create "bind variable" in my DB to support any procedure in my DB.
    Thank you very much.

    In SQL*PLUS we can defined bind variable
    SQL>var x varchar2(250); -- Is x bind variable or i'm misunderstand ?
    and ... in my procedure i can used ' &x ' to pass valued of 'x' from sql prompt to my procedure.
    but i'm not sure variable x is still remain in DB because i need to pass variable
    " v_stmt := 'and employee_id between ..... ' " from FORM to PROCEDURE in DB
    how can i do

  • Using c++ variable in apple script

    Hi all,
    I am just calling the apple script from my indesign plugin.
    I need to pass the c++ variable to apple script for opening a file
    This in my apple Script which i have embedded in c++ code
    tell application "TextEdit"
    activate
    open "Users:User1:Library:Preferences:Adobe Indesign:Version 5.0:MathEQ.txt"
    end tell
    The filepath "Users:User1:Library:Preferences:Adobe Indesign:Version 5.0:MathEQ.txt" is stored in the C++ variable char* textFileName.
    I need to use the variable textFileName in apple script which has the path.
    How to go about it?
    Thanks
    Sakthi

    I have a similar problem trying to get data from any field into an AppleScript variable.
    Something like *set phoneNumber to cell "Phone Number" of current record* works fine if you are using the script from a layout that has this field on it.
    But I have a lot of fields on different layouts and I want to have access to all fields in the table, no matter what layout they are on, or what layout is currently active.
    And I want to do this without having to specify on what layout each field is located.
    In the past (FileMaker 6) I used something like *set phoneNumber to (cell "Phone Number" of current record of database 1)* but this is no longer working in FileMaker 9.
    So I was thinking to use something like *set phoneNumber to cell "Phone Number" of current record of table "Table Name"* but that doesn't seem to work.
    The only thing that seems to work is *set phoneNumber to cell "Phone Number" of current record of layout "Layout Name"* but as I said, I don't want to specify the layout for each field.
    Any ideas anyone?
    Message was edited by: khasmir

  • How to pass a shell variable to rman scripts

    I want to backup datafile to different directory
    depending on the current time,and I can do this to
    pass a shell variable to rman scripts,and this
    variable will used as part of format ,like this:
    backup incremental level=0
    tag rman_inc0_bck
    filesperset 5
    format '$(DIR)/rman_fulldb_%u_%s_%p_%d'
    (database include current controlfile)
    and $(DIR) is shell variable ,but rman will not
    recognize this ,how to achieve this?

    You could send your script to rman thru a pipe | or <<
    echo "backup incremental level=0
    tag rman_inc0_bck
    filesperset 5
    format '$(DIR)/rman_fulldb_%u_%s_%p_%d'
    (database include current controlfile);" | rman target /You could also create a "temp script" and then use it from rman with cmdfile
    sed "s,XXXDIR,$(DIR)," yourtemplate > /tmp/rmanscript.$$
    rman target / cmdfile /tmp/rmanscript.$$
    rm /tmp/rmanscript.$$

  • How do I create a automated file backup script?

    I need a backup script to move files  from the MAC to Google Drive everyday at a certain time.  I tried using automator to create a calendar flow but it does not run when I set it up in calendar.  Can someone provide me a simple script template with Apple script or tell me how to do this?

    How are you backing up?   The Automator Calendar alarm should work.  Test with Automator first by creating a Workflow, then see if it works within Automator when you click "Run" 

  • How to check indesign version installed by Apple Script

    Hi Friends,
    I want to make an apple script which will check for the version of Indesign installed in the "Applications" folder.
    I tried using "exists" function of Finder. But seems something is missing/incorrect.
    tell application "Finder"
              exists application file "Adobe InDesign CS4" of folder "Applications"
      end tell
    Please can you suggest.
    Thanks,
    Abhishek

    Hi Niel,
    Thanks for your email.
    Basically, I need to check whether a user has which version of Indesign on his mac like (CS3, CS4 etc)
    Accordingly, I have to create different loops.
    I have CS4 installed on my mac but when I run the below
    tell application "Finder"
              exists version of application file "Adobe InDesign CS4" of folder "Applications" of startup disk
    end tell
    The result is false.. even though I have CS4 installed. And, if I try
    get version of application "Adobe InDesign CS4"
    It gives o/p as  "6.0.6.622"
    Thanks for your help!
    Abhishek

  • Create local variable using labview scripting

    I am trying to use labview scripting to create a control and a local variable for that control.  I want both the local variable and the control contained inside a case structure.  My problems are twofold:
    1. the local variable is left blank/unnamed
    2. the local variable is wired outside of the case structure, even though I set it's owner to be the same as the owner for the control (which is placed inside the case structure).
    The flat panel is there because I thought that my problem might be a result of the local var being created before the actual control, so this just forces the control to be created first.  The other thing I wonder about is the VI Object Class for the local variable.  I have tried 'Node' and Control->Boolean, but neither worked.
    I have attached a jpg of the code I'm talking about.  The picture on thetop is of the code in question.  The picture on the bottom is of the resulting code that's created....
    Can anyone offer any help?
    Thank you...
    Attachments:
    vi_scripting_lv.png ‏95 KB

    The reason your locals aren't tied to a control, is because you didn't make a local variable from any control.  Use the Boolean reference wire and wire it to an Invoke Node and select the Create >> Local Variable method.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • How do I create a variable that uses Previous() and references itself.

    I am trying to create a crosstab with a number of meaures in it. I have a variable called opening stock and another called closing stock. The opening stock for day 2 is the closing stock for day 1 and is a variable [LV Opening Stock] defined as =Previous([closing stock];Row).  This works fine. But, the closing stock for day 2 is the opening stock plus production minus sales. So my variable has to reference the previous days closing stock.
    When it is defined as =[LV Opening Stock]+[Planned Production Qty]-[Forecast Daily Qty] it validates but when I try to save it I get the following message :  The formula for variable [LV Opening Stock] contains a reference to a variable with the same short name. You must use the fully-qualified variable name in the formula to remove this ambiguity. (Error: WIS 10040)
    How do I solve this? What is the fully-qualified name? Is it because it's effectively referencing itself?
    I'm using XI R2 sp4
    Thanks
    John

    Hi. I'm having the same issue. Please share with us if you find a solution.
    Many thanks.

  • How do I create a variable that is a time?

    What I need is a variable that is a time such as 13:00 that can be used in an equation like 13:00 - 12:30 = 00:30 or 13:00 - 12:45 = 00:15 etc.
    I have no idea how to do this because if I use something like:
    var Onsite = 12:30
    var Offsite = 13:00
    I get the following message:
    Consecutive statements on a line must be separated by ;
    It is pointing to the : and that makes sense but if I use this:
    var Onsite = "12:30"
    var Offsite = "13:00"
    Then I can't use it as an equation because it is being treated as text.
    Any ideas?

    Look at the NSDate class if your using Objective-C (or Swift), it can be used to create points in time (date + time) and can determine the distance (in seconds) between to points, using the -timeIntervalSince* methods.

  • How do I create and use an Apple ID without a credit card or gift card?

    My brother just bought a Ipod touch 2nd generation, ios 4.2.1, but I was trying all day yesterday trying to setup his Apple ID, but it keeps asking for his credit card. I read through some other posts that said to download a free app and it'll give you the coice to create a new account. So I did that. I filled out all of the information and it let me select "None" as the billing information, so I thought it was all set. He verified the account through his e-mail, it said "Your email has been verified", so he tried to sighn into the app store using his e-mail he verified, but it said something like "This ID hasn't been used on this device". The only options were Cancel or Review, so I clicked review and it took me to the registration thing again, all of the info was already filled out, except the billing info which wouldn't let me select "None".
      I tried sighning his account on to my ipod touch, it did the same thing as his, He's sighned in with mine right now, but whenever he downloads something, it downloads for me too.
       So if you can help, I'd really appriciate it, because it pretty annoying.

    You have to follow the instructions here and use an email address that you have not yet used with Apple before.
    Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card

Maybe you are looking for