Another script for someone to doctor

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

  1. macrumors 68030

    Benjamindaines

    #1
    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:
    Code:
    activate
    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"
    	repeat
    		if file (thefolder & "Chat with " & theName & theNo & ".rtfd") exists then
    			if theNo is "" then
    				set theNo to 2
    			else
    				set theNo to theNo + 1
    			end if
    		else
    			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 textedit.app

    --Thank you for your efforts.
     

Share This Page