Another script for someone to doctor

Discussion in 'Mac Programming' started by Benjamindaines, Mar 25, 2006.

  1. Benjamindaines macrumors 68030


    Mar 24, 2005
    A religiously oppressed state
    Reciently I started a thread asking for a script to so something (I will quote the thread). Eraserhead wrote the script (which works wonderfully except it doesn't do the formatting). So if anyone knows how to get this thing to keep the formatting from the clipboard please edit it so it keeps the formatting.

    The "quest":
    The script:
    set theName to the text returned of (display dialog "Who is the conversion with?" default answer "")
    tell application "Finder" to set theClipboard to the clipboard
    set thefolder to the path to desktop as string
    set theNo to ""
    tell application "Finder"
    		if file (thefolder & "Chat with " & theName & theNo & ".rtfd") exists then
    			if theNo is "" then
    				set theNo to 2
    				set theNo to theNo + 1
    			end if
    			exit repeat
    		end if
    	end repeat
    	make new file in folder thefolder with properties {name:("Chat with " & theName & theNo & ".rtfd")}
    	write theClipboard to file (thefolder & "Chat with " & theName & theNo & ".rtfd")
    end tell
    EDIT: I think I know how this must be done, it will probably work if you tell the script to create the file through

    --Thank you for your efforts.

Share This Page