[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lisp strings to str255



    Date: Tue, 25 Feb 1992 08:39 PST
    From: sdobbs@trivia.coginst.uwf.edu (Steven Dobbs)

    I tried the with-pstrs function, but I cannot get it to work.  Here is the
    code that I have, it anyone can help.

    (defun doit ()
      (rlet ((myrec :aeaddressdesc)
	     (mystr :str255))
      (let ((openfile (choose-file-dialog)))
	(with-pstrs ((mystr openfile)))  ;; converts string to str255
	;;(checkError (#_AECreateDesc #$typeFSS mystr (length openfile) myrec))
  
      )))

    This is supposed to get a file name and convert it to a str255 so that I
    can use it in an apple event.   It gets to the with-pstrs and retruns the
    following error

    > Error: Argument #P"Tsunami: Steve:Steve's Lisp Folder:Eliza.lisp" is not of type SEQUENCE.
    > While executing: DOIT
    > Type Command-. to abort.
    See the Restarts  menu item for further choices.
    ?>

(CHOOSE-FILE-DIALOG) returns a pathname object.  WITH-PSTRS is
expecting a string.  You can get the string form of the pathname
by invoking the NAMESTRING function on the pathname:

(let ((openfile (namestring (choose-file-dialog))))
  ...)