How to manage file name containing a date with /

Dar Scott dsc at swcp.com
Mon Jul 22 09:16:36 EDT 2013


André,

I'm not sure why this will not work to create the file name:

get "Joe PATIENT - bio checkup - 09" & numToChar(240) & "2013.pdf"

I think I might not be understanding the situation.  Are these all files on a network file server or a portable storage?  They look one way (with colons) on a Mac (with colons) and look another way on Windows (with the dot)?

I also may have made an error in character encoding calculation.  I'll double check that.

Dar


On Jul 22, 2013, at 6:50 AM, André Bisseret wrote:

> Bonjour,
> 
> Jacque, Dar and Peter, thank you much for your attention to my problem.
> Since your posts I made a number of trials during the weekend, following your suggestions but with no success.
> 
> Reminder : the names of the files I am trying to launch from script have the following format :
> Joe PATIENT - bio checkup - 09/2013.pdf
> 
> On Mac the slash is replace automatically by colon (:) (don't know why!)
> Anyway, all is working well 
> I can open a file by double-clicking on it in the folder 
> And, I can launch it by script (using its filename). No problem.
> -------
> On Windows, the : (colon) is replaced with what seems to be a character ( a kind of dot. (or small bullet point?) with a sort of white space before it and a white space after. But, these are not "space" character (one can't delete them; on can only select the all 
> - Double-clicking on a document opens it (good)
> 
> - But to launch a document from a script I need to replace : (colon) with this dot in the filename of the document.
> I can't!!!
> - When  I copy this "dot" and paste it in the script editor, it is immediately replaced with "?"
> and replacing colon by ? does not work
> -----
> I tried pasting it in the message box: there, it is immediately replace with "ð :(quote followed by ð
> trying to replace colon :
> - I can't use  "ð (I suppose it's because they are 2 characters)
> - trying only ð does not work
> 
> - In the message box of the PC I tried to get the number of this (kind of) dot
> put CharToNum('') and pasting a copy of the "dot" between the 2 quotes as suggested by Jacque
> the dot is immediately replaced by "ð
> and I get the error: error: Script: missing " after literal
> 
> the ASCII number of " is 34 and those of ð is 240
> so I tried put numToChar(34) & numToChar(240) into tVar
> replace ":" by tVar in tDocName > does not work
> 
> I don't know what I could do next?
> 
> Dar, there are several thousands files with such names ; I can't imagine the only solution be to change ( manually) all these names!
> I am using livecode (rev) since 2006; it is the first time I am blocked that much 
> 
> Any other idea?
> 
> Thanks a lot in advance for any help
> 
> Best regards
> 
> André
> 
> 
> 
> 
> 
> 
> Le 19 juil. 2013 à 17:24, J. Landman Gay a écrit :
> 
>> "André Bisseret" <andre.bisseret at wanadoo.fr> wrote:
>>> So I tried 
>>> put quote & numToChar(240) into tVar
>>> replace ":" with tVar in tDocName  > again no success 
>>> 
>>> When I paste the mysterious char directly in the script it is
>>> immediately replaced by "?" 
>> 
>> In the message box,  do this :
>> 
>> put charToNum('')  
>> 
>> and paste the copied character between the quotes.  That gives you the actual number of the character being used. Then in your script use numToChar(<whatever>) to do the replacements. 
>> -- 
>> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
>> HyperActive Software           |     http://www.hyperactivesw.com
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list