Welcome to Programming LiveCode Q&A, where you can ask questions and receive answers from other members of the community.

Please, ask questions about the book only. If possible, mention section or page number. Don't ask for opinions, ask clear and direct questions only.

Go to main site

Quick Links

Frequently Asked Questions

Errata (1st print)

answer file: how to get the arabic name of a file

+1 vote
p. 157

(Mac OS 10.8) I have an UTF8 file created with TextEdit called "ثسسشه.txt" in the answer file dialog (it's actually "txt.ثسسشه" on the desktop).

Answer file returns "/Users/jhausser/Desktop/?????.txt" and of course my script doesn't find the file to read it.

Except changing the file name manually to something more occidental on the desktop, I didn't find a simple way to deal with this problem. Should I use embedded applescript instead of answer file ?

It's probably an important question for people not using latin characters.
asked Jun 4, 2013 by jhausser (730 points)

1 Answer

+1 vote
I have created a library for this. Indeed, AppleScript seems to be the way to go. The problem is that you have to recreate a complete file management system parallel to LiveCode's existing features. Whenever you need to file, you need to use a reference to that file and make your AppleScript look up the correct file path using that reference. You will also need a system to read and write, move, delete and copy files. It is a huge amount of work.

Edit: I gave this a little more thought. It would be possible to write an AppleScript to duplicate the file to a temp folder, rename it and use the file from there.
answered Jun 5, 2013 by mark (3,090 points)
edited Jun 7, 2013 by mark
luckily I don't have this problem in my usual activity. I tumbled on this problem in your book...
Is your library available somewhere ?
Currently, it is not available, as it is unfinished, but you can let me know if you have a real need for it.
...