How do I create a UNIX path to a file inside Application Support?

I need to create a path that uses "/" to seperate the location. It needs to be variable on the user. The code I'm having trouble with is this section: (Some of the variable I have not specified in this post because they serve no purpose to my question.
set appName to "Mc_Launcher"
set subFolder to "Mc_Log.txt"
set permPath to (POSIX path of ((path to application support folder from user domain) & Mc_Launcher & subFolder))
set FileTXT to (("Login on " & (current date) & " successful, took " & timer & " seconds to complete.") as text)
set ShellLog to ("echo " & FileTXT & ">> " & permPath)
do shell script ShellLog

It looks like you are having a similar problem with the part of the script that makes your folder, so I have separated them below.  The statements used will create the folder and file if needed, and there won't be an error if they already exist.
# create folder and file if needed
set appName to "Mc_Launcher"
set baseFolder to (POSIX path of (path to application support folder from user domain) as text) & appName
do shell script "mkdir -p " & quoted form of baseFolder
set logFile to "Mc_Log.txt"
set permPath to baseFolder & "/" & logFile
do shell script "touch " & quoted form of permPath
# write to log file as needed
set FileTXT to "Login on " & (current date) & " successful, took " & timer & " seconds to complete."
set ShellLog to ("echo " & FileTXT & " >> " & quoted form of permPath)
do shell script ShellLog

Similar Messages

  • How do I create Required UNIX Groups  in my Mac OS X version 10.3.9 ?

    Hi there,
    How do I create Required UNIX Groups in my Mac OS X version 10.3.9 ?
    During my Oracle 10g client installation, the doc. reads, "Start Workgroup Manager (/Applications/Server/Workgroup". But I don't see this server directory in my system.
    Thnaks in advance.
    siva

    Hi siva
    you can use the commandline nicl for this. It is described in the install docs that come with the database.
    regards,
    Ronald.
    http://homepage.mac.com/ik_zelf/oracle

  • How can I create a link from a CHM file to a webhelp file?

    How can I create a link from a CHM file to a webhelp file?
    The CHM output (accreditation.chm) is stored in a parent directory, and the webhelp output (index.htm) is stored in a child directory.

    Open the usual Link dialog and enter the relative path from where the CHM will be installed to where the webhelp will be installed.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • How to accessed,created and modified date of particular file in java

    Hi,
    I am facing one problem.
    I know how to get the modified date/time of file in java.
    but i don't know how to find created and accessed date/time of file in java.
    Thanks,
    Tejas

    I guess thats not possible in in Windows.
    But if u r trying it on a unix machine.
    You can use Runtime class to call exec on the command
    ls -l filename
    and then store the result in a file . And then take out the last modified time. But you cant get created time.
    Thats a clumpsy way i believe.

  • RE: How can I create a page break in a file?

    Thank you, Glen. I tried WriteText. But it didn't work.
    Tien Wang
    Indus Consultancy Services
    [email protected]
    From: Glen A. Whitbeck
    Sent: Thursday, September 11, 1997 11:59 AM
    To: Wang, Tien
    Cc: forte-users; owner-forte-users
    Subject: Re: How can I create a page break in a file?
    Instead of using "WriteLine," try using "WriteText" ("WriteLine" writes
    TextData into an open file, while "WriteText" writes data to a stream)
    like this:
    <method 1>
    myFile : file = new();
    myFile.WriteText('\f');
    Glen
    Wang, Tien wrote:
    Hi,
    I am creating a text file for a report which contains multiple pages.
    How can I create a page break in my file? I tried to use the
    following
    two methods, but neither of them works. Specifically, it seems a
    special
    character printed in the file. But when I print the file through a
    WordPad, it didn't separate pages.
    I am currently using version 3.0.C on Windows NT 4.0 with a HP Plus 4
    printer. Any help will be greatly appreciated.
    Tien Wang
    Indus Consultancy Services
    [email protected]
    >
    <method 1>
    myFile : file = new();
    file.writeLine('\f'); --- \f is the form feed in the C language
    <method 2>
    myFile : file = new();
    j : IntegerData = new( value = 14 );
    c : char = j.IntegerValue; -- c now contains ascii 14 (form feed)
    p : pointer to char = &c; -- Set a pointer to the character
    pageBreakTxt : TextData = new();
    pageBreakTxt.Concat(p);
    myfile.writeLine(pageBreakTxt);

    Tien,
    Try myFile.WriteText('\x0c'); instead of myFile.WriteText('\f');
    Regards
    Richard Stobart
    -----Original Message-----
    From: Wang, Tien [SMTP:[email protected]]
    Sent: Friday, September 12, 1997 6:09 PM
    To: Glen A. Whitbeck
    Cc: forte-users; owner-forte-users
    Subject: RE: How can I create a page break in a file?
    Thank you, Glen. I tried WriteText. But it didn't work.
    Tien Wang
    Indus Consultancy Services
    [email protected]
    From: Glen A. Whitbeck
    Sent: Thursday, September 11, 1997 11:59 AM
    To: Wang, Tien
    Cc: forte-users; owner-forte-users
    Subject: Re: How can I create a page break in a file?
    Instead of using "WriteLine," try using "WriteText" ("WriteLine" writes
    TextData into an open file, while "WriteText" writes data to a stream)
    like this:
    <method 1>
    myFile : file = new();
    myFile.WriteText('\f');
    Glen
    Wang, Tien wrote:
    Hi,
    I am creating a text file for a report which contains multiple pages.
    How can I create a page break in my file? I tried to use the
    following
    two methods, but neither of them works. Specifically, it seems a
    special
    character printed in the file. But when I print the file through a
    WordPad, it didn't separate pages.
    I am currently using version 3.0.C on Windows NT 4.0 with a HP Plus 4
    printer. Any help will be greatly appreciated.
    Tien Wang
    Indus Consultancy Services
    [email protected]
    >
    <method 1>
    myFile : file = new();
    file.writeLine('\f'); --- \f is the form feed in the C language
    <method 2>
    myFile : file = new();
    j : IntegerData = new( value = 14 );
    c : char = j.IntegerValue; -- c now contains ascii 14 (form feed)
    p : pointer to char = &c; -- Set a pointer to the character
    pageBreakTxt : TextData = new();
    pageBreakTxt.Concat(p);
    myfile.writeLine(pageBreakTxt);

  • How can I create a page break in a file?

    Hi,
    I am creating a text file for a report which contains multiple pages.
    How can I create a page break in my file? I tried to use the following
    two methods, but neither of them works. Specifically, it seems a special
    character printed in the file. But when I print the file through a
    WordPad, it didn't separate pages.
    I am currently using version 3.0.C on Windows NT 4.0 with a HP Plus 4
    printer. Any help will be greatly appreciated.
    Tien Wang
    Indus Consultancy Services
    [email protected]
    <method 1>
    myFile : file = new();
    file.writeLine('\f'); --- \f is the form feed in the C language
    <method 2>
    myFile : file = new();
    j : IntegerData = new( value = 14 );
    c : char = j.IntegerValue; -- c now contains ascii 14 (form feed)
    p : pointer to char = &c; -- Set a pointer to the character
    pageBreakTxt : TextData = new();
    pageBreakTxt.Concat(p);
    myfile.writeLine(pageBreakTxt);
    -----------------------------------

    Tien,
    Try myFile.WriteText('\x0c'); instead of myFile.WriteText('\f');
    Regards
    Richard Stobart
    -----Original Message-----
    From: Wang, Tien [SMTP:[email protected]]
    Sent: Friday, September 12, 1997 6:09 PM
    To: Glen A. Whitbeck
    Cc: forte-users; owner-forte-users
    Subject: RE: How can I create a page break in a file?
    Thank you, Glen. I tried WriteText. But it didn't work.
    Tien Wang
    Indus Consultancy Services
    [email protected]
    From: Glen A. Whitbeck
    Sent: Thursday, September 11, 1997 11:59 AM
    To: Wang, Tien
    Cc: forte-users; owner-forte-users
    Subject: Re: How can I create a page break in a file?
    Instead of using "WriteLine," try using "WriteText" ("WriteLine" writes
    TextData into an open file, while "WriteText" writes data to a stream)
    like this:
    <method 1>
    myFile : file = new();
    myFile.WriteText('\f');
    Glen
    Wang, Tien wrote:
    Hi,
    I am creating a text file for a report which contains multiple pages.
    How can I create a page break in my file? I tried to use the
    following
    two methods, but neither of them works. Specifically, it seems a
    special
    character printed in the file. But when I print the file through a
    WordPad, it didn't separate pages.
    I am currently using version 3.0.C on Windows NT 4.0 with a HP Plus 4
    printer. Any help will be greatly appreciated.
    Tien Wang
    Indus Consultancy Services
    [email protected]
    >
    <method 1>
    myFile : file = new();
    file.writeLine('\f'); --- \f is the form feed in the C language
    <method 2>
    myFile : file = new();
    j : IntegerData = new( value = 14 );
    c : char = j.IntegerValue; -- c now contains ascii 14 (form feed)
    p : pointer to char = &c; -- Set a pointer to the character
    pageBreakTxt : TextData = new();
    pageBreakTxt.Concat(p);
    myfile.writeLine(pageBreakTxt);

  • How do i create a single instance of a class inside a servlet ?

    how do i create a single instance of a class inside a servlet ?
    public void doGet(HttpServletRequest request,HttpServletResponseresponse) throws ServletException, IOException {
    // call a class here. this class should create only single instance, //though we know servlet are multithreaded. if, at any time 10 user comes //and access this servlet still there would one and only one instance of //that class.
    How do i make my class ? class is supposed to write some info to text file.

    i have a class MyClass. this class creates a thread.
    i just want to run MyClass only once in my servlet. i am afriad, if there are 10 users access this servlet ,then 10 Myclass instance wouldbe created. i just want to avoid this. i want to make only one instance of this class.
    How do i do ?
    they have this code in the link you provided.
    public class SingletonObject
      private SingletonObject()
        // no code req'd
      public static SingletonObject getSingletonObject()
        if (ref == null)
            // it's ok, we can call this constructor
            ref = new SingletonObject();          
        return ref;
      public Object clone()
         throws CloneNotSupportedException
        throw new CloneNotSupportedException();
        // that'll teach 'em
      private static SingletonObject ref;
    }i see, they are using clone !, i dont need this. do i ? shouldi delete that method ?
    where do i put my thread's run method in this snippet ?

  • How can I create a vector path boundary around an image?

    I have enclosed a screenshot of an image created in Photoshop CS4 with a wacom. It shows a grey boundary stroke around the entire image which was created with edit/stroke, then color and width of stroke selected.
    What I want to do is to bring this image into Illustrator CS4 and create a vector path boundary aroun d the image in the same way as the stroke boundary in Photoshop. But I dont know how to do thatx except by doing it manually with the pen tool.
    Does anyone know if it is possible to create a vector path around the image in a similar way that I created the stroke line around the image in Photoshop?
    I need the vector path to make a cutting line for a laser cutter, which works with vector files.
    Thanks for any advice about this.

    Not only should you draw the cut path deliberately with the Pen Tool, but that entire illustration should have been drawn as vector paths to begin with. In fact, if it were me, I would do that now anyway. It's nicely done, but illustrations like that are much more versatile and valuable as a vector drawings, because they are infinitely scaleable withou degradation of sharpness.
    Had it been drawn as vector paths, generating the outset cut line could be semi-automated by merging a copy of all the paths and then just outsetting the resulting path.
    Vector illustrations like that, consisting of just a few colored fills and strokes, can be entirely cut and assembled from sign vinyl at any scale, rather than resorting to merely printing the artwork and then cutting around it.
    Edits (recoloring, reshaping) can be easily made to vector paths without degradation, because each path is a separate object.
    And whenever you do need a raster image, a raster image suitable for any purpose can be exported from a vector drawing at any time. Each such rasterization is pristine, because no re-rasterization is involved.
    Not meaning to preach you a sermon; it just seems so many visitors here who have only used raster imaging don't even understand the reasons why vector drawing exists. This kind of graphic begs to be created as vector paths, and is also the very kind which would be ideal for vector-drawing beginners to start with. So it's just a good case-in-point.
    JET

  • How can I create a link to download a file in Captivate?

    So, in my Captivate file, I want people to be able to download an XML file to their machine.  If I create a hyperlink to "open a file", then when a user clicks on it, captivate attempts to open the xml file in a browser window instead of downloading it.  I can't figure out how to use the download attribute for an href in captivate and I'm not sure if javascript to do this would execute properfly.  Anybody know the best way to accomplish a force download of a file from a captivate presentation (Captivate 6)?
    TIA.

    If you want to really do this so that it is consistent for all browsers, you'll need to implement this at the server level.  I did this with the Dynamic PDF Export Widget.  Typically, a PDF will be displayed in the browser, but I added the ability to download it instead.  It does require a PHP file (or some other server side script).  In the PHP file, you'll want to set the response header for Content-Disposition to "attachment"... that's the key.
    The elbow grease part has to do with managing how the browser handles the link.  You'll want the Captivate hyperlink to open a new window so that the student does not navigate away from your course in the current window.  But since you are opening a PHP file, you can inject javascript into the document of the new window/tab to close itself.  The download will still continue eventhough the window/tab was programmatically closed.  However, most modern browsers will automatically close the window/tab for you when downloading a file.  If you want to see an example of a PHP file that implements this, go ahead and download the trial version of the Dynamic PDF Export widget.  You'll see the create.php file in the zip package.
    http://captivatedev.com/2012/07/25/adobe-captivate-6-x-widget-dynamic-pdf-export/
    If you want to go simple as TLC Media Design suggested, just zip it and let your students unzip the xml file, or just rename the xml file with a .zip extension and tell them to rename the file back to .xml after downloading.

  • How can I create a web Service from my Web Dynpro Application ?

    Hi,
    Kindly let me know How I could create a "Web Service" with my Web Dynpro DC project.
    Awaiting your responses.
    Regards,
    Mahesh

    Hi Mahesh,
          You can use the web services by creating the Model in web Dynpro
    And if you want to publish your own web service then you have to create a EJB module and publish as a web service.
    Thanks
    Ninad

  • How do I create a Disk Image of a FILE?

    How do I get Disk Utility to make a .dmg (regular or encrypted) of a single FILE, not a Folder, Disk or Device, without using a third party utility? OR are 3rd party utiities a better choice for Disk Image creation?
    I've read all the "Help" info and it only covers creating a .dmg of a Folder, Disk or Device NOT an individual/single file. [Unless I'm blind]
    No matter what I do only folders, disks, and devices are highlighted but all files are grayed out during any .dmg creation.
    PowerBook G4 Ti 15" (400-MHz)   Mac OS X (10.4.8)   1GB RAM, 80MB HD, AE, AEBS

    Yes, that's correct, at least not directly. You can create a blank disk image, copy the file to the mounted disk image, then burn the image to a CD/DVD.
    Open Disk Utility and select Blank Disk Image from the New menu. Provide a name, Save location, and select the image size from the drop down menu. Leave Encryptions at None and Format as read/write. Click on the Create button.
    After the image file appears the "removable" disk should be automatically mounted. If not double-click on it to mount it. A "removable" disk icon will appear. Drag the file you want to place on the disk image to the "removable" disk icon. The eject the "removable" disk icon. Now select the disk image file in the DU left side list and click on the Burn icon in the DU toolbar. Be sure to have a blank disc ready.
    The above is actually the "long" way to do this. A much easier way is to simply insert a blank CD or DVD into the optical drive. The Finder will pop up a dialog asking what to do. Select the option to mount on the Desktop. You will now see a disc icon on the Desktop. Drag the file you want to burn to the CD/DVD, right-click or CTRL-click on the disc icon and select Burn from the contextual menu.
    Why reward points?(Quoted from Discussions Terms of Use.)
    The reward system helps to increase community participation. When a community member gives you (or another member) a reward for providing helpful advice or a solution to their question, your accumulated points will increase your status level within the community.
    Members may reward you with 5 points if they deem that your reply is helpful and 10 points if you post a solution to their issue. Likewise, when you mark a reply as Helpful or Solved in your own created topic, you will be awarding the respondent with the same point values.

  • How to handle spaces in using path to the file

    Hi Friends,
    I am getting error "file not found" if I give path of the file that contains spaces in it. (eg. C:\Users\Sample Project\file.txt)
    If I give path that doesn't contain spaces (eg. C:\Users\Sample\file.txt) then it works fine without any error.
    Basically I am invoking one command at runtime (using "exec") in my java program that excepts path of the file as one parameter.
    I can't remove space by manipulating path - othewise that path will be different.
    How can I solve this issue?
    Thanks

    Works for me:
    import java.io.*;
    public class ProcessExample {
        public static void main(String[] args) throws IOException {
            if (args.length == 0) {
                Runtime r = Runtime.getRuntime();
                dump(r.exec("java ProcessExample foo \"bar baz\""));
            } else {
                for(String s : args) {
                    System.out.println(s);
        static void dump(Process p) throws IOException {
            BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream()));
            for(String s; (s = r.readLine()) != null; ) {
                System.out.println("[" + s + "]");
    }But ejp's advice is even better.

  • How can we create a ABAP object into .ptr file

    HI,
          How can we create a ABAP object into .ptr/.car/.sar format so that we can give it to a remote client and which can be imported into their R/3 system to get the functionality of this object.

    Hello Ramesh
    All you need is SAPLINK. Have a look at the following links:
    <a href="/people/ed.herrmann/blog/2005/11/14/the-enterprise-and-the-bazaar Enterprise and the Bazaar</a>
    <a href="https://sourceforge.net/projects/saplink/">SAPLINK</a>
    Regards
      Uwe

  • How do you create a podcast list by adding files?

    I have a site that has mp3s, but no podcasting subscription type tools (http://www.emmanuelnyc.org/sermons/index.html)
    I want to download the mp3s then listen to them on my ipod touch.
    How do I create a podcast group and add these files to it? I tried "add folder to library" and "add file to library" and cant' find it anywhere in itunes. Tried searching and searching... no clues.
    any assistance appreciated.

    The page you linked to has only MP3 files. There is no RSS feed (Podcast button), so those files cannot be downloaded "as Podcasts".
    However, if you right-click  any one of them you will see an option to "Save link as..." or "Save file as...", which will then allow you to download and save the MP3 onto your computer. It is not a Podcast, it is simply an MP3 file.
    A Podcast is a file (usually audio or video) that has been downloaded using an RSS feed. It is the process of being downloaded as an RSS feed that defines it as a Podcast. No matter what anyone else tells you, you cannot download an MP3 file and the turn it into a Podcast.
    Since the site provides no method of downloading the files in bulk, or automatically, then you will have to download each one individually. Put them all in one common folder.
    To add them to your iTunes Library, in iTunes, turn on the menu bar using the CTRL+B command. Then, on the File menu is...
    and using Add Folder To Library will allow you to add the files, in that folder, to your Library in one move.
    Now that the files are in your Library, you still cannot "make them appear to be Podcasts". Once again, this is the case - no matter who might tell you otherwise.
    But -
    I'm going to assume that you do not want these files to play when you're listening to your music, especially in shuffle mode. This is often why people want to set these files as Podcasts (and various bodges have been tried in order to try and achieve this end).
    The trick is to set the files to Skip when shuffling and this can be done to all the files at once. Highlight all the files in question and select File/Get Info/Options>Skip when shuffling and change the drop-down to Yes.
    Now, since they are set to skip when shuffling, that's exactly what will happen. It also means that you can start (and play the whole of) each file individually and if the iPod is still in shuffle mode, it will stop at the end of each episode. To play several, or all episodes without pause, simply turn off shuffle and navigate to the first episode. They will then play one after the other.
    By the way, you cannot use the custom podcast feed method that you mentioned. It's simply another bodge.

  • How to create a inbound IDOC from flat file in Application server

    HI All
    Our requirement is to create the Inbound idocs from a flat file from application server with in R/3
    Could any body please let me know the steps required for this.
    Thanks
    Malli

    1. Read the file using OPEN DATASET and read and fill up the segment info and fill the EDIDC header data
    and then call function
    CALL FUNCTION 'INBOUND_IDOC_PROCESS'
        TABLES
          IDOC_CONTROL       =  i_edidc
          IDOC_DATA          =  i_edid4.

Maybe you are looking for