How to make a file reference

Applescript file reference causes me more confusion then normal in Applescript.
How do I construct a user reference free file reference.
-- set fn to path to file "my speaking document.rtf" of documents folder
-- set fn to   "my speaking document.rtf" of folder "Documents" of folder "mac" of folder "Users" of startup disk
-- set fn to POSIX file (get "~/Documents/my speaking document.rtf")
set fn to POSIX file (get "/Users/mac/Documents/my speaking document.rtf")
log "fn = " & fn
tell application "TextEdit"
   open file fn
end tell

You could also have a look at [Aliases and Files|http://developer.apple.com/mac/library/documentation/AppleScript/Conceptu al/AppleScriptLangGuide/conceptual/ASLRfundamentals.html#//appleref/doc/uid/TP40000983-CH218-SW28] in the [AppleScript Language Guide|http://developer.apple.com/mac/library/documentation/AppleScript/Conceptu al/AppleScriptLangGuide/introduction/ASLRintro.html#//appleref/doc/uid/TP40000983-CH208-SW1].

Similar Messages

  • How to make html file on server side from the data entered in text area

    Hi!
    I want to know how to make .html file on server side. Like if i enter the data in text area ( or like we normaly see when we write mail that editor) and we can use html tages in it and when user submit form all the data in that field will be saved on server side as an html formate. Is it possible to do so??? or any ruff idea how to design it???

    Erm ...
    Whats the problem with that?!
    Ok, here the code ...
    String myparameter = request.getParameter("paramname");
    String htmltemplate = "<html>\n"
                         +"<head><title>demo</title></head>\n";
                         +"<body>@parametertag@</body>\n";
                         +"<html>";
    String htmlpage = htmltemplate.replaceAll("@parametertag@",myparameter);
    File yourHTMLfile = new File("wheredoyouwannagotoday.html");
    FileOutputStream fos = new FileOutputStream(yourHTMLfile);
    fos.write(htmlpage.getBytes());
    fos.close();You're done.
    Happy Coding! :-) &copy;

  • How to make Jar files in JBuilder

    I would like to know how to make jar files using JBulider. I have a problem with a project that I am working with in Swing. I have made the project on JBuilder and when I make a jar file it will not run upon clicking.
    Any body with an answer, please help
    Abhi

    It sounds like your Main-Class is not set properly in your manifest. To set your Main-Class, please follow these directions:
    http://java.sun.com/docs/books/tutorial/jar/basics/run.html

  • How to make jar files availabe for deployed EJBs

    Hi,
    I'm interested on how to make jar files availabe for deployed EJBs.
    My EJB is packed in an ear. It uses a util jar. I now just add the jar to the
    classpath, but I think that shouldn't be the way. Is there somthing in the admin
    console to make jars available or do I have to insert it in the ear file? And
    if so, where do I hve to place it?
    Thanks
    Claudia

    Put the util.jar in the ear with your ejb jars - at the same level (i.e. in
    the root) - but do not include them in the manifest.xml.
    Also each ejb jar that refers to util.jar must have util.jar on its internal
    classpath in the manifest.
    "Claudia" <[email protected]> wrote in message
    news:3d537db5$[email protected]..
    >
    Hi,
    I'm interested on how to make jar files availabe for deployed EJBs.
    My EJB is packed in an ear. It uses a util jar. I now just add the jar tothe
    classpath, but I think that shouldn't be the way. Is there somthing in theadmin
    console to make jars available or do I have to insert it in the ear file?And
    if so, where do I hve to place it?
    Thanks
    Claudia

  • How to make html file from a text field data

    hi!
    I want to know how to make a file with .html extension and the data in this file should be from a text field. like i want to enter some thing in a text area and have to place it in a file on server side in html formate.

    so you told us what you want, but what is your question?

  • How to make word files in mac

    how to make word files, presentations orview such files in mac

    Open Office can be opened in MS Word, and vice versa, looks nearly 100% same as Office and Word but is FREE
    tons use it
    http://www.openoffice.org/download/index.html

  • How to make pdf file auto open with adobe reader after downloaded

    how to make pdf file auto open with adobe reader after downloaded

    I note from your system details that you have the plugin for adobe pdf s so I would have expected the files should open in firefox '''without''' you needing to explicitly download them.
    Once the files are open in firefox, you will also get the option to save them permanently to a location on your computer. If you wish I suppose you could set the file type pdf to be associated with and be opened by firefox instead of with the Adobe Acrobat Reader, but that would just seem to be an additional complexity.

  • How to make audio file to use as ringtone on iPhone 5

    Does anyone know how to make a file and then make it a ringtone?

    Make sure iTunes prefs > Import settings is set to AAC.
    In iTunes, find the song you want and note the start/stop time you want the ring tone.
    Right click - get info, click the Options tab and set the start/stop times as above. (Note a 30 second max for ringtones)
    Right click - Create AAC version. This creates a new file.
    Drag this new file from the iTunes window to the desktop.
    Delete the new file from iTunes and also select Delete from hard drive.
    On the desktop, rename the file to what_ever_you_want.m4r (first part you can change to whatever you want & change the extension to .m4r).
    Drag the file back to the iTunes library at top left.
    Make sure iTunes prefs > General has Tones ticked.

  • How to make jar file for this compilation method ?

    can any one tell me how to make jar file for this compilation
    D:\java\browser\IEInJava>javac -classpath jdic.jar;. IEInJava.java
    D:\java\browser\IEInJava>java -cp jdic.jar;. IEInJava
    *this is a compile code:-*
    D:\java\browser\IEInJava>javac -classpath jdic.jar;. IEInJava.java
    *and this is a run code:-*
    D:\java\browser\IEInJava>java -cp jdic.jar;. IEInJavanow how make JAR file ?

    Assuming IEInJava only uses classes inside the jdic jar, this is one way. D:\java\browser\IEInJava> jar cf yourjar.jar IEInJava.classThen to run it you would use D:\java\browser\IEInJava> java -cp jdic.jar;yourjar.jar IEInJavaAnother way would use the jar manifest file to specify the Main-Class and Class-Path.

  • How to make PDF file size smaller from an Illustrator file without changing the quality or size (length and width) of the file?

    Is there a way to make a 30x42 size (40 GB) Illustrator file as a PDF but make the file smaller in size (able to email to clients) with out compromising the quality of the file or the size of the file?

    If you are working in RGB you can embed a colour profile. Embed ICC Profiles is one of the Acrobat save options. It will increase files size dramatically.
    When you save your pdf you can choose the compression method for placed images. Default is ZIP which is really no compression at all for pixel images. Instead you should opt for JPG compression (of varying degree according to how sensitive the images are to compression).
    You should also examine the other Acrobat save options. To minimize file size you should not have any of the options checked (Preserve Illustrator Editing Capability, Embed page Thumbnails etc. etc.).
    40 gigabytes for a file like the one you show is ridiculous. Did you maybe embed the placed images? If so, don’t. Keep them linked unless you really need to embed them.

  • How to make jar files at runtime in a server application

    I am using Jung API and i need to load the class files in this JAR file for my application at runtime.
    I am using an applet which uses this API which is loaded with the help of a Servlet.
    The code is getting compiled but the JAR files and associated classes are not available at the runtime
    How to make themk avalable.
    I have tried various options like placing jar files in
    WEB-INF/lib
    $Catlina_Home/commons/lib
    But it is not working can anyone help me it is of high urgency to me
    How to make that classes in the JAR file available to my applet at runtime

    SuperJavaHello wrote:
    How to make that classes in the JAR file available to my applet at runtimeAhh! The runtime is an appler! The applet is on the Client, and the Client does not have access to the Server's classpath. You need to un-pack the JAR, then re-pack the classes into the JAR used to pack your Applet, the one that you are using as the code source in the applet tag.

  • How to make "open file" function

    Is there a method that you can call that can prompt the user to open a file? Here is what I have:
    var file:FileReference = new FileReference;
    var newFile:BitmapData = new BitmapData (600,290,false);
    newFile.draw(file.upload(file.browse()));
    var s:Shape = new Shape();
    s.graphics.beginBitmapFill(newFile);
    s.graphics.drawRect(0, 0, board.width, board.height);
    s.graphics.endFill();
    board.addChild(s);
    What would I put in the line in bold to achieve this?

    How do I convert the File Reference to the bitmap data or a shape? This is what I have right now:
    var file:FileReference = new FileReference();
    var newFile:BitmapData = new BitmapData(600,290,false);
    file.browse();
    var selectedFile:FileReference;
    file.addEventListener(Event.SELECT, file);
    function f(e:Event)
    var selectedFile = FileReference(e.target);
    newFile.draw(e.target);
    var s:Shape = new Shape();
    s.graphics.beginBitmapFill(newFile);
    s.graphics.drawRect(0, 0, board.width, board.height);
    s.graphics.endFill();
    board.addChild(s);

  • CS3, Encore; How to make a file for a mediaplayer

    Hallo there,
    How can I make a file in Encore CS3 that is readeble in a mediaplayer like a Popcorn.
    I know how to build a Blu-ray ofcourse, but I want to deliver a file to my customer for his mediaplayer.
    Can someone help me, because Adobe helpline in Holland does not cover Adobe CS3 anymore.
    I hope to hear from someone out there on this planet
    Greetings,
    Bert

    From Encore nothing that results in a single file.
    2 options.
    1) Build to a folder and play the DVD folder.  The method varies on the mediaplayer.  For Windows Media Player on XP, I just right click the first .ifo file in the VIDEO_TS folder and "Play."
    2) From Encore, Export to Flash.  The produces a web page (and folders) that can be played locally through a browser.

  • How To Make A File Splitter In Java

    Hey everyone...is it possible to make a file splitter program in java swing?what API do you think should be used in creating that application and how does it work? Assume that the application will be ran on windows desktop. Thanks to all...

    * FileSplitter.java
    import java.util.*;
    public class FileSplitter {
        ArrayList list = new ArrayList();{
            list.add("test 01");
            list.add("test 02");
            list.add("test 03");
            list.add("test 04");
            list.add("test 05");
            list.add("test 06");
            list.add("test 07");
            list.add("test 08");
            list.add("test 09");
            list.add("test 10");
            list.add("test 11");
            list.add("test 12");
            list.add("test 13");
            list.add("test 14");
            list.add("test 15");
            list.add("test 16");
            list.add("test 17");
            list.add("test 18");
            list.add("test 19");
            list.add("test 20");
            list.add("test 21");
            list.add("test 22");
            list.add("test 23");
            list.add("test 24");
            list.add("test 25");
            list.add("test 26");
            list.add("test 27");
            list.add("test 28");
            list.add("test 29");
            list.add("test 30");
        public FileSplitter() {
            testAlgorithm();
        private void testAlgorithm(){
            final int randNo = list.size()/2;//=number of input records / 2
            Random r = new Random();         //creates a new random number generator
            List newlist = new ArrayList();  //constructs a new empty list
            while(list.size()> randNo) {//returns true if the number of elements in the list is greater than randNo
                //(half of the input records are splitted)
                int index = r.nextInt(list.size());//returns a random between 0 (inclusive)
                //and the number of elements in the list (exclusive)
                newlist.add(list.get(index));//returns the element at the specified position in the list
                //and appends it to the end of newlist
                list.remove(index);//removes the element at the specified position in the list
                //and shifts any subsequent elements to the left
            System.out.println("newlist: "+newlist);//one part of the file
            System.out.println("list: "+list);//the other part of throws file
        public static void main(String[] args) {
            new FileSplitter();
    }

  • How to make a file "hidden"

    This question might sound stupid but here it goes. How do you hide a file?, i know how to view hidden files (onyx) but i dont know how to make a normal file as hidden

    On a related note, I am looking for a way to hide only those files that I want hidden. Some hidden files I need to access on an almost-daily basis, but others, like .DS_Store and such, I'll never need direct access to.
    So, is there an official way to set up a custom list of file names and/or file regex patterns so only certain files are hidden from the Finder?
    Thanks!
    MacBook Pro 17 2.33GHz/2GB/100GB   Mac OS X (10.4.8)   Development Machine

Maybe you are looking for

  • Change order of components in FlowPane

    I'm interested how I can change with mouse drag and drop the order of components in FlowPane. I have a example which can work with TabPane and drag tabs between two TabPanes: public class DragPanel {     private static final String TAB_DRAG_KEY = "pa

  • Is it possible to create web services for classes and bol objects?

    i am new to crm web channel,can any one  please ,help me.... thank u in advance, kiran.

  • How can I supply path for exportAsText( )  /  importTextData( )   /  saveAs( )

    How can I reference/provide a path for JavaScript commands that will point the user to an appropriate directory on either a local drive or network? More specifically ... I have a button that Exports Data as a text file from a pdf form (AcroForm) by s

  • Can't sync all song in library to ipod

    Hi! I just got the latest itunes version and can't sync all songs in my library to ipod. It is manually set to manage songs and when I select all songs to drag (more than 2,000) it is only syncing 281...help please!!!

  • Root CA Certificate Update?

    Hi, I have been testing with various GPS fixes on my XPERIA device and I want to report certain issues my phone is having... Device: Sony Xperia Sola Version: Android 4.0.4 (Stock) - 6.1.1.B.1.54 Issue: GPS takes a long time to lock on "precisely" So