How do I make a variable path in AppleScript?

I'm mass distributing an application, and for the next update I want to add customization. My application currently make a folder in the "Documents" folder. The folder is called "MCL_CONFIG". What I need to do is make a unicode text file in "MCL_CONFIG". Since it's going to be used on many different computers the path to where I'm making the new file has to change depending on the user. How can I make a variable path to a non-directory? Here's the section of my code with the problem:
tell application "Finder"
    if folder MCLConfig exists then
    else
        display dialog "Welcome to Mc Launcher! You will only recieve this message once, unless you delete the MCL_CONFIG folder." buttons {"Ok"} default button 1
        make new folder at New_User with properties {name:"MCL_CONFIG"}
    end if
end tell
It's not shown but I set the variable MCLCONFIG to (path to documents folder from user domain) & "MCL_CONFIG" as text.
As a side note how do I make the code look like it does in applescript, here?

You can do something like:
set supportFolder to ((path to application support from user domain) as text)
set appName to "My Spiffy App"
set subFolder to "MCL_CONFIG"
tell application "Finder" -- add application support folders if needed
  if not (exists folder (supportFolder & appName)) then
    make new folder at folder supportFolder with properties {name:appName}
    make new folder at result with properties {name:subFolder}
  end if
end tell
Edit: it is recommended that the folder in Application Support be named with your application's bundle identifier, but most just use the application name.

Similar Messages

  • How do I make a clipping path around a feather or hair?

    I want to make a clipping path around a person who has hair blowing in the wind. How can I make a good clipping and get close enough without losing the effect?

    This is a good tutorial:
    http://www.graphic-design.com/Photoshop/remove_backgrounds/index.html
    There are many others such as those in here:
    http://forums.adobe.com/thread/370974?tstart=0

  • How do I make a "file path" field in a spreadsheet?

    i need to have a column of file paths of images relating to each entry of data, in order to integrate with a data-driven layout in InDesign. but when i drag a file, it will either display a tiny image of the file (in the case of jpegs) or show the file name only (with other file types). how can i drag and drop files and get the full file path to show up in the data? that is what i need to import into InDesign. help!
    thanks

    Hello
    This script may help:
    --(SCRIPT Récupère_Chemin]
    ---+-+-+-+-
    Exécuter ce script ou déposer l'icône d'un fichier
    sur son icône (script enregistré en tant qu'application ou progiciel application)
    permet de passer dans le presse-papiers
    le chemin d'accès complet
    Save the script as Application or Application bundle on the desktop.
    Drag and drop a file's icon on the script's icon.
    You will get the full pathname of the file in the clipboard
    so you will be able to paste it where you want.
    Yvan KOENIG le 22 mars 2004
    remanié le 24 février 2008
    -- -+-+-+-+-
    property englishMsg : true
    property msg99 : "" -- globale
    --deux lignes exécutées si on double clique l'icône du script
    if englishMsg is true then
    set _ to choose file with prompt "Choose a file …"
    else
    set _ to choose file with prompt "Choisir un fichier …"
    end if
    open (_ as list)
    on open sel -- sel contient une liste d'alias des éléments
    --qu'on a déposés sur l'icône du script (la sélection)
    if msg99 is "" then my prepareMessages()
    TraiteLeFichier(item 1 in sel)
    end open -- fin 2
    on TraiteLeFichier(zefile)
    try
    set leChemin to zefile as text
    set the clipboard to leChemin
    on error MsgErr number NroErr
    if NroErr is not -128 then
    beep 2
    tell application (path to frontmost application as string) to ¬
    display dialog "" & NroErr & " : " & MsgErr with icon 0 ¬
    buttons {msg99} giving up after 20
    end if
    return
    end try
    end TraiteLeFichier
    on prepareMessages()
    if englishMsg is true then
    set msg99 to "Oops"
    else
    set msg99 to " Vu "
    end if
    end prepareMessages
    --[/SCRIPT]
    Yvan KOENIG (from FRANCE dimanche 24 février 2008 12:53:31)

  • How can I make a variable-size list  ?

    Hi guys,
    I'm trying to make a flexible list using <mx:List> component, I mean when I add an item or if the item size is changed (ex: collapse/expand) the list size must change.
    Is there an easy way to do that ? If you have any idea, please don't hesitate to post it here. Thanks in advance.
    Ygor

    It sounds like you're doing 2 distinct things; 1) adding new items to the dataProvider, 2) The item renderer is expanding or collapsing.
    If that is the case: 1) when you add an item to the dataProvider, increase the size of the list, 2) when the item renderer is expanding or collapsing, access the list through the "owner" property of the item renderer to change the size of the list.

  • How do I make 3 variables global throughout????

    I want to be able to access them in the functions getInput and printToFile
    I want to make the following 3 stacks global:
    Stack headOutput = new Stack ();
    Stack bodyOutput = new Stack ();
    Stack footOutput = new Stack ();
    I want to put them in this program:
    import java.io.*;
    import java.lang.*;
    import java.util.*;
    public class Assemble
         public static void main(String args[]) throws IOException
              if (args.length > 0) //     Checks to see if there are any arguments
                   printArgumentInfo ();
              else // if no arguments run the program
                   getInput ();
                   printToFile ();
    }

    it compiles.. but.. i get what is below when the program runs.. if i make the stack's static.. then i can't add to them.. isn't that the reason?... i need those 3 stacks to go through the functions getInput and printToFile and those are static methods...
    Exception in thread "main" java.util.EmptyStackException
    at java.util.Stack.peek(Stack.java:82)
    at java.util.Stack.pop(Stack.java:64)
    at Assemble.printToFile(Assemble.java:183)
    at Assemble.main(Assemble.java:29)

  • How can I define the variable "UITableViewScrollPositionNone" in Applescript-Objc?

    I'm trying to select a row in a Table View using the following code:
    NavigationTable's selectRowAtIndexPath_animated_scrollPosition_((IndexHandler's indexPathWithIndex_(1)), true, UITableViewScrollPositionNone)
    (IndexHandler is the NSIndexPath class)
    But when I run the code, I get the error:
    The variable UITableViewScrollPositionNone is not defined.
    How do I define "UITableViewScrollPositionNone", in Applescript-Objective-C?

    For some strange reason, after admitting that I'm utterly lost, and after literal days of endless searching, I've found the proper snippet of code.
    For those who need to select an NSTableView row in Applescript-Objc:
    property IndexSetHandler : class "NSIndexSet"
    set DefaultRow to (IndexSetHandler's indexSetWithIndex_(1))
    NavigationTable's selectRowIndexes_byExtendingSelection_(DefaultRow, false)
    Thank you both for all the help you've given me as well, and sorry for bothering you with previous response.

  • AS3 alternatives to _global variable path?

    Hi, through out a very old complicated fla there are buttons which set variables using _global paths
    such as:
    function menu1_2(Event:MouseEvent) {
        global.mode = "hide_hotbox";
    MovieClip(this).gotoAndStop("stage_1_b");
    How can I make the variable "hide_hotbox" and others like it accessible and changeable from any movie clip -- whether they be nested in other movie clips or on the main timeline, etc?
    Thank you...(wits end)...extremely appreciated

    yes I will
    and post the code here
    in the meantime, I'm also going to ask as a side note on future threads: how can one keep up with scripting trends and expected actionscript changes?
    I just have one, very, very complicated website -- and otherwise work in CG, etc. most of my time...a few times a year I make graphical changes to this website but updating it from AS 1 to AS 2 and now AS 3 has been a heart stopping nightmare...I'm sure, absolutely confident, if and when I have a family and children I just will not be able to keep up this site...I plan to scale it down, but, how can one be sure to write code now which has a chance of lasting?  Are there trends and viewpoints within the Actionscript community which one could use to anticipate changes in AS 4.  I would have put my code on timelines rather than buttons and named all the buttons when I originally created the site in AS 1 if I had known I'd have to refamiliarize myself with the guts and bolts of this monster horrific site once again.  When I am senial, this site is dead...it is taking every neuron I have.
    sources used for research thus far:
    http://www.uza.lt/codex/as3-global-object/
    most elegant:
    http://www.kirupa.com/forum/showthread.php?p=2110832
    clear:
    http://www.websitemediaplayers.com/blog/global-variables-as3/
    thanks again

  • Make a variable return a random number?

    I need to know how to quickly make a variable return a random number, in PHP if i wanted a variable to return a random number it'd look like this using a built in function,
    (int)$my_variable = rand(0,10); // returns 0 through 10 randomly
    How can i do this with Java if say my variable looks like this.
    public Integer madeThisUp = 1; // Needs to be random 0-10 aswell..
    I can't find any tutorials on this that make clear sense to me, :-\

    2) java.util.Random has a bunch of methods that
    correspond directly to common uses of random numbers.
    I can't imagine a situation where Math.random would
    be easier to understand.case in point, when a method is provided for you but you
    try to reinvent it with:
    int i = (int) (Math.random() * 10);

  • How do I edit value of PATH variable in AIX?

    How do I edit value of PATH variable in AIX?

    Hi Sandy,
    You need to edit .profile file from the users home directory...
    (Please note DOT before filename, which make the file hidden...)
    use "ls -a" command to list hidden files.
    its a basic question, why don't you search google for such issues.
    It will also help you to understand the system better...
    Regards.
    Rajesh Narkhede

  • GNU make ignores the PATH variable

    I just want to restate what was said in this post (that is now archived):
    http://discussions.apple.com/thread.jspa?threadID=2144085
    I have the exact same problem. The PATH variable is not taken into account when running simple commands in a makefile. If I change the command to something just a little more complex, like "echo hello && command" it works. So it seems to be an optimisation problem.
    I am running GNU Make 3.81 on Mac OS X 10.6.4.

    On 08/17/2015 05:50 AM, matt matt wrote:
    > Having installed cygwin and editing the PATH variable was not sufficient
    > for me because I'm running a user account.
    >
    > When I run "gcc -v" in cmd.exe I get the output: "..not recognized as an
    > internal command"
    > When I run "gcc- v" in cmd.exe as administrator this is no problem.
    >
    > How can I make this work for the user account?
    There's an Eclipse forum dedicated to C/C++ questions you might wish to
    post in. It's called Eclipse CDT.

  • How to make a Beziere path with REC.

    I'am tring to follow a flashlight with a particle emmiter. I want to make a beziere path with different points across the timeline using the REC mode. And then attach the particle to the path so it can follow correctly with speed and curves the flashlight. How do i do this?

    Kyle,
    Presuming you wish to move one circle to snap to another circle at a certain predetermined angle, and you have it placed at a distance at that angle you may (Smart Guides are your friends):
    1) Select both circles, and with the Line Segment Tool drag a line from centre to centre (Smart Guides say center when you are at the first one and close enough to the second one);
    2) Select the circle to move with the normal Selection Tool, then hover over the spot where the line crosses it (Smart Guides say intersect), then ClickDrag along the line (Smart Guides say path) until you have dragged it to snap to the other circle (Smart Guides say intersect).
    This works whether the circles are beside each other or one is inside the other.
    When moving vertically or horizontally, there is no need for the line, and you can just ClickDrag by the relevant Anchor Point.

  • How can I make the SSH_CONNECTION enviromental variable available

    Greeting,
    I have a Sun Server has Solaris 9 Sparc OS installed.
    $uname -a
    SunOS zcyds383 5.9 Generic_118558-01 sun4u sparc SUNW,Netra-240
    When I use Putty SSH2.0 to login into it. I echo the SSH_CONNECTION. The variable doesn't exit
    $echo $SSH_CONNECTION
    $env |grep SSH
    SSH_CLIENT=10.11.11.120 4285 22
    SSH_TTY=/dev/pts/2
    I also check the version of sshd package
    $ pkginfo -l SUNWsshdr
    PKGINST: SUNWsshdr
    NAME: SSH Server, (Root)
    CATEGORY: system
    ARCH: sparc
    VERSION: 11.9.0,REV=2002.04.06.15.27
    BASEDIR: /
    VENDOR: Sun Microsystems, Inc.
    DESC: Secure Shell protocol Server
    PSTAMP: crash20020406153754
    INSTDATE: Apr 20 2005 20:59
    HOTLINE: Please contact your local service provider
    STATUS: completely installed
    FILES: 15 installed pathnames
    8 shared pathnames
    5 linked files
    8 directories
    1 executables
    13 blocks used (approx)
    I also check the /etc/ssh/sshd_config, I don't find any entry related to the client.
    Anyone, could u please tell me how to make this variable available except  install/update the ssh packages.?
    Thank u very much!
    Regards.

    Deleted and re-installed...
    Still get the following:
    The selected topic is currently unavailable
    Make sure you’re connected to the Internet. For help connecting, choose Apple menu > System Preferences, click Network, and click “Assist me.”
    If you’re connected to the Internet, and the content still doesn’t appear, try again later.

  • How do I...Mimic Replacement Path with Query using Customer Variable Exits?

    Hello SDN:
    We are on BW 3.5 SP16.
    We are currently using a replacement path Query(RP) with variables
    to populate a variable in another Query(T).
    The problem we are having is with performance.
    The entry of variables in replacement path Query(RP) is optional (This is necessary there cannot be required values)
    When results from Replacement Path Query are small performance is fine. (e.g. 10 seconds)
    When results from Replacement path query are large performance suffers. (e.g. 1+ minutes)
    Users are free to leave the replacement path variables empty resulting in a large set of data to be replaced. This is the worst performance case.
    We would like to discover a way to conditionally execute the replacement path query. That is if users do not enter values for the replacement Query(RP) variables do not execute the replacement path query(RP).
    Does anyone know if this is possible within reason and in customer exit space?
    We have reviewed the situation from all angles and the requirement for the replacement path FUNCTIONALITY and the freedom for the user to leave variable values blank remains.
    I've been searching and reading SDN and SAP notes for about a week and do not find threads which address this situation.
    We are also exploring Customer variable exits to mimic replacement path functionality
    (different topic subject="How do I...Mimic Replacement Path with Query using Customer Variable Exits?")
    Any help will be appreciated
    Many thanks
    David Schuh

    My appologies-I posted this message with the wrong subject. I will repost it with appropriate subject.
    dave schuh

  • How can I make Spotlight show the file path

    How can I make Spotlight show the file path in the Spotlight menu for selected file?

    Via Finder certainly, but not in the menu.  You can view the file path in the Spotlight search results display by pressing the ⌘ key (while hovering over a file in the results), though.  The path will display at the bottom of the Quick Look output, or cycle through that location.

  • How to make a complex path with circles and pathfinder

    So I keep seeing this method of design on sites like dribbble or behance but I don't know how to do it!
    Here's an example:
    Basically a bunch of circles are used to create this awesome shape and design. I have a general idea on how to use the pathfinder tool and I have used it a lot in the past, but how do you snap circles together with smart guides? It seems that the smart guides only snap based on 90 or 45 angles and don't snap edges of objects together unless there are two anchors.
    Here's an example:
    I want to use the curves from 2 circle shapes to make a complex path. But I can't get the two paths to snap together
    Ultimately to create something like the raindrop image above. I want to use the perfect curves on circles to create more complex shapes but since the paths do not snap together, I'm just eyeballing it to be close enough to do something with the pathfinder tool. I have tried many ways to solve this but I cannot figure anything out.
    Kyle

    Kyle,
    Presuming you wish to move one circle to snap to another circle at a certain predetermined angle, and you have it placed at a distance at that angle you may (Smart Guides are your friends):
    1) Select both circles, and with the Line Segment Tool drag a line from centre to centre (Smart Guides say center when you are at the first one and close enough to the second one);
    2) Select the circle to move with the normal Selection Tool, then hover over the spot where the line crosses it (Smart Guides say intersect), then ClickDrag along the line (Smart Guides say path) until you have dragged it to snap to the other circle (Smart Guides say intersect).
    This works whether the circles are beside each other or one is inside the other.
    When moving vertically or horizontally, there is no need for the line, and you can just ClickDrag by the relevant Anchor Point.

Maybe you are looking for

  • Not dirtying the document...

    Hi All, I'm using a hidden filter called from an automation plugin. The hidden filter doesn't modify the current document - it exists to put up a dialog with a preview using a proxy image and get some other parameters from the user. My problem is tha

  • Searching in iTunes

    When I create a new playlist in iTunes, and want to add songs, I get a long list of songs. Although there is a Search box in the upper right corner, it does not work. No cursor no keyboard appear. So, how can I search in iTunes? BTW, the search box i

  • Converting doc in pdf

    Hello ! I need to know how to : 1. convert my word doc to pdf 2. I want to be able to email the new pdf file to someone and I want them to be able to print it out but not be able to edit it. Thank you

  • Help Menu Keeps coming to the front

    Is there a way to stop the Help Menu from always being the top window? When trying to find something in the Help Menu, it always stays on the top and I can not get to the windows behind it. Is this a preference somewhere?

  • How to stop the slideshow?

    Hello, sorry, but my english is not very good. But I try to explein my problem: At the moment I am testing elements 8 and I Think, I will buy this program. Very interesting is the slideshow with the different ways to change from one pic to the other.