Scripts not loading on mac despite UTF-8/.bas extension - General Help and Assistance on using CHDK stable releases - CHDK Forum supplierdeeply

Scripts not loading on mac despite UTF-8/.bas extension

  • 9 Replies
  • 3562 Views
Scripts not loading on mac despite UTF-8/.bas extension
« on: 11 / April / 2008, 10:06:14 »
Advertisements
Must be missing something, but I've tried every option for saving out of textedit I can think of, and no scripts seem to work.

Took bracketing.bas (out of the default script set)
Made a new file in textedit, converted to plain text,
copied & pasted contents of bracketing.bas into file
saved as: bracketing2.bas, unchecked "If no extension is provided, use ".txt"", selected Unicode UTF-8,
saved directly to scripts folder of camera.

When I open it up in the camera's text reader, I get a bunch of garbage and near the top:
Mac OS X  (garbage......)
(garbage)
ATTR: (garbage...)
com.apple.TextEncoding (garbage) UTF-8 (lots more garbage)
(garbage for 4050 characters or so)
Arrow up symbol, This resource fork intentionally left blank (garbage)

Seems like it's hitting a resource fork instead of just the text of the script.  Any ideas how to get rid of it, or any ideas what else might be going wrong?

Re: Scripts not loading on mac despite UTF-8/.bas extension
« Reply #1 on: 11 / April / 2008, 10:14:38 »
Investigating further, these files dont seem to have a resource fork.  Using terminal command
 ls -l bracketing.bas
I get
 -rwxrwxrwx@ 1 wyner  wyner  456 Apr 11 15:31 bracketing.bas
And trying ls -l bracketing.bas/rsrc directly on the memory card, it says
 ls: bracketing.bas/rsrc: Not a directory
(When I do it on my harddrive, it shows a filesize of 0, also indicating no resource fork.)

So!  Where on earth is the camera getting all these garbage characters and "com.apple.TextEncoding", etc?

Re: Scripts not loading on mac despite UTF-8/.bas extension
« Reply #2 on: 11 / April / 2008, 10:16:13 »
Also, opening the script in terminal/vi shows the script, none of this garbage that the camera seems to find.

*

Offline whim

  • ******
  • 2041
  • A495/590/620/630 ixus70/115/220/230/300/870 S95
Re: Scripts not loading on mac despite UTF-8/.bas extension
« Reply #3 on: 11 / April / 2008, 10:24:28 »
Hi

Don't know a lot about macs, but I just checked out a script in my multi-format text editor and it says
(for all *.bas files in the trunk script folder) that they're ANSI encoded, not Unicode (UTF-8 = a form of unicode AFAIK)
In fact, I don't think there's any Unicode or support for it in CHDK (please correct me if I'm wrong - devs ? )
So my advice would be to try it with plain old ASCII ( with LF, not CR-LF )

hope that helps,

wim
« Last Edit: 11 / April / 2008, 10:37:57 by whim »


Re: Scripts not loading on mac despite UTF-8/.bas extension
« Reply #4 on: 11 / April / 2008, 10:56:35 »
Good idea, but no luck. :P  Saved as non-lossy ASCII, since it wouldn't let me save it as Western(ASCII), and got the same behavior

Re: Scripts not loading on mac despite UTF-8/.bas extension
« Reply #5 on: 11 / April / 2008, 15:52:07 »
Alrighty!  Got it working.  Apparently the problem is I was opening the invisible file ._bracketing.bas that os x sticks onto the drive, instead of bracketing.bas itself.  Woot.

Re: Scripts not loading on mac despite UTF-8/.bas extension
« Reply #6 on: 11 / April / 2008, 17:26:01 »
Deleted
« Last Edit: 22 / April / 2008, 17:30:40 by Barney Fife »
[acseven/admin commented out: please refrain from more direct offensive language to any user. FW complaints to me] I felt it imperative to withdraw my TOTAL participation. Nobody has my permission, nor the right, to reinstate MY posts. Make-do with my quoted text in others' replies only. Bye

*

Offline CMC68

  • *
  • 20
Re: Scripts not loading on mac despite UTF-8/.bas extension
« Reply #7 on: 22 / October / 2009, 02:46:24 »
Hi, I'm suffering the same problem and search lead me to this thread.

Can anyone suggest a Mac based text editor that allows me to save in the correct format (and confirm what that format is ASCII/ANSI LF/CR-LF)

Thanks

Chris


*

Offline whim

  • ******
  • 2041
  • A495/590/620/630 ixus70/115/220/230/300/870 S95
Re: Scripts not loading on mac despite UTF-8/.bas extension
« Reply #8 on: 22 / October / 2009, 06:39:04 »
Hi CMC68

Have you read this page ? http://chdk.wikia.com/wiki/FAQ/Mac
(it has a section "How to Copy Script Files Without Errors" ...)

HTH,

wim

« Last Edit: 22 / October / 2009, 06:40:59 by whim »

*

Offline CMC68

  • *
  • 20
Re: Scripts not loading on mac despite UTF-8/.bas extension
« Reply #9 on: 22 / October / 2009, 07:07:10 »
You're a star, thank you. I'll read the whole FAQ in more detail.

Chris

 

Related Topics