Loading ...
Sorry, an error occurred while loading the content.

script(do... question

Expand Messages
  • onetriadrr
    I m trying to resolve a need to read resources of any type into SC as text. I ve got a classic AS applet and OSAX i used in OS9/classic to read resources to do
    Message 1 of 18 , Aug 1, 2004
    View Source
    • 0 Attachment
      I'm trying to resolve a need to read resources of any type into SC as text.

      I've got a classic AS applet and OSAX i used in OS9/classic to read resources to do this.
      Works perfectly when run directly from the classic AS script editor.

      But when called from OSX SC via script(do...) the applet fails and returns the generic
      syntax or execution error message rather than it's custom error message.

      In the past I've called OSX AS applets from SC (running under classic or OSX) to run other
      applications which in-turn were running under classic or OSX without difficulty.

      In otherwords...
      telling an OSX AS applet via script(do...) works when SC is running under classic or OSX
      but..
      telling a Classic AS applet via script(do..) doesn't seem to work if SC is running under OSX.

      Is this correct, or have i missed something?

      BYW: anyone know if Tiger will resolve the 'OSX is Unix' catch-22 with the TCL 'resource'
      shell command?

      DCS
    • onetriadrr
      ... Located Tcl extension at SourceForge that returns resource commands to tclsh. Sucessfully reads TEXT resources so far. Appears there may be difficulties
      Message 2 of 18 , Aug 1, 2004
      View Source
      • 0 Attachment
        --- In SuperCard@yahoogroups.com, "onetriadrr" <one@t...> wrote:
        > I'm trying to resolve a need to read resources of any type into SC as text.
        >
        > BYW: anyone know if Tiger will resolve the 'OSX is Unix' catch-22 with the TCL 'resource'
        > shell command?
        >

        Located Tcl extension at SourceForge that returns resource commands to tclsh.
        Sucessfully reads 'TEXT' resources so far.
        Appears there may be difficulties with other res types... 'plst' for instance.

        Will post script after a little more testing.

        DCS
      • Chilton Webb
        Wouldn t it be easier to have a generic resource reading external? -Chilton
        Message 3 of 18 , Aug 1, 2004
        View Source
        • 0 Attachment
          Wouldn't it be easier to have a generic resource reading external?

          -Chilton

          On Aug 1, 2004, at 4:37 AM, onetriadrr wrote:

          > I'm trying to resolve a need to read resources of any type into SC as
          > text.
        • Tomas Franzén
          ... I think you could do something like this: 1. Copy the resource in question to the project s (or another proj s) data fork as a star resource. This should
          Message 4 of 18 , Aug 1, 2004
          View Source
          • 0 Attachment
            On 2004-08-01, at 11.37, onetriadrr wrote:
            > I'm trying to resolve a need to read resources of any type into SC as
            > text.

            I think you could do something like this:

            1. Copy the resource in question to the project's (or another proj's)
            data fork as a star resource. This should be possible with CopyResource
            from XTend.
            2. Use the startest external from the Internals Toolbox samples to read
            the data from the star resource.

            It's not exactly the most elegant solution ever, but it should work. As
            Chilton said, an external for this would be better.

            Tomas Franzén
            Lighthead Software
            http://www.lightheadsw.com/

            I'm listening to Metallica - My World
          • onetriadrr
            ... Why yes it would! But with so many opportunities to torture my self, not nearly as fun in a S&M way. In the process, i ve gotten a TCL shell call working
            Message 5 of 18 , Aug 1, 2004
            View Source
            • 0 Attachment
              --- In SuperCard@yahoogroups.com, Chilton Webb <chilton@m...> wrote:
              > Wouldn't it be easier to have a generic resource reading external?
              >
              > -Chilton
              >
              > On Aug 1, 2004, at 4:37 AM, onetriadrr wrote:
              >
              > > I'm trying to resolve a need to read resources of any type into SC as
              > > text.

              Why yes it would!
              But with so many opportunities to torture my self, not nearly as fun in a S&M way.

              In the process, i've gotten a TCL shell call working nicely.
              No pain, no gain.

              DCS
            • onetriadrr
              ... resource ... The mouseup hander & function below asks that you select the SC app and then reads & returns the plst resource as text. Requires
              Message 6 of 18 , Aug 1, 2004
              View Source
              • 0 Attachment
                --- In SuperCard@yahoogroups.com, "onetriadrr" <one@t...> wrote:
                > --- In SuperCard@yahoogroups.com, "onetriadrr" <one@t...> wrote:
                > > I'm trying to resolve a need to read resources of any type into SC as text.
                > >
                > > BYW: anyone know if Tiger will resolve the 'OSX is Unix' catch-22 with the TCL
                'resource'
                > > shell command?
                > >
                >
                > Located Tcl extension at SourceForge that returns resource commands to tclsh.
                > Sucessfully reads 'TEXT' resources so far.
                > Appears there may be difficulties with other res types... 'plst' for instance.
                >
                > Will post script after a little more testing.
                >

                The mouseup hander & function below asks that you select the SC app and then reads &
                returns the 'plst' resource as text.
                Requires 'TclResource 1.1' (link below)
                (Link to rtf file with scripts below also.)

                Not very speedy, but faster than the days, weeks or months it would have taken me to
                learn just enough C++.

                on mouseup
                answer file "Select SuperCard application"
                if it = "" then return ""
                put it into fpath

                get TclReadRes(fpath,"plst",0,"T")
                --param 1: the mac path to file
                --param 2: 4 char resource code
                --param 3: res id number or name
                --param 4: 'T' or 'D' (T; comverts utf8 to macRoman discarding unconvertable characters;
                -- D: does no encoding conversion)
                -- do something with it
                end mouseup

                function tclReadRes fpath,rType,rID,TorD
                if length(rtype) ? 4 then
                --handle error
                return ""
                end if
                put getResources(fpath,rType,"R") into reslist
                if line 1 of reslist = "false" then return ""
                delete line 1 of it
                put cr before reslist
                if "," & rID & "," is not in reslist and cr & rid & "," is not in reslist then return ""
                get script(do,applescript,merge("tell application `Finder` to get posixpath of alias
                `[[fpath]]`"))
                if char 1 of it ? quote then
                --handle error
                return ""
                end if
                delete first char of it
                delete last char of it
                put it into fpath
                put merge("package require resource\set rRef [resource open -resourcefork `[[fpath]]`
                RDONLY]\set rText [resource read `[[rtype]]` `[[rID]]` $rRef]\resource close $rRef\puts
                $rText") into tcl
                put replace(tcl,"\",linefeed) into tcl
                if TorD = "T" then get shell(merge("echo '[[tcl]]' | tclsh | iconv -c -s -f utf8 -t
                macroman"))
                else get shell(merge("echo '[[tcl]]' | tclsh"))
                return it
                end tclReadRes

                script link: http://24.199.175.86/supercard/TCL/TclReadREs.rtf"
                --------------------------------------
                The tclresource extension to tcl can be had at:
                http://sourceforge.net/projects/tclresource/
                Lists/reads/writes/deletes res and data fork resources.

                It's a dragNdrop install of the unstuffed folder into '/Library/Tcl/' (may have to make a
                'Tcl" folder).
                Install instructions and man page html are included.

                DCS
              • Chilton Webb
                Hi Ken, ... I m a bit confused here. Are you saying these files (TheVolumeSettingsFolder) are in the stuffed file once it decompresses, or on the flash card
                Message 7 of 18 , Aug 1, 2004
                View Source
                • 0 Attachment
                  Hi Ken,

                  On Aug 1, 2004, at 7:54 PM, Ken Norris (dialup) wrote:
                  > I dropped it on Stuffit and transfered the file to a flash card to
                  > bring
                  > home and post to the files area, but when I opened it, I found a ton of
                  > nested folders named "TheVolumeSettingsFolder", one inside another
                  > inside
                  > another inside another -- about 7 or 8 nested levels of almost the same
                  > things, I think, all of them locked, and with spurious other documents
                  > in
                  > them as well.

                  I'm a bit confused here. Are you saying these files
                  (TheVolumeSettingsFolder) are in the stuffed file once it decompresses,
                  or on the flash card itself prior to decompressing it?

                  -Chilton
                • Ken Norris (dialup)
                  Howdy, I finall got finished with my SC instrument chooser and player last night, Wel,l about 4:00 am this morning. I dropped it on Stuffit and transfered the
                  Message 8 of 18 , Aug 1, 2004
                  View Source
                  • 0 Attachment
                    Howdy,

                    I finall got finished with my SC instrument chooser and player last night,
                    Wel,l about 4:00 am this morning.

                    I dropped it on Stuffit and transfered the file to a flash card to bring
                    home and post to the files area, but when I opened it, I found a ton of
                    nested folders named "TheVolumeSettingsFolder", one inside another inside
                    another inside another -- about 7 or 8 nested levels of almost the same
                    things, I think, all of them locked, and with spurious other documents in
                    them as well.

                    What the heck _is_ all that junk? My file is buried somewhere in there and
                    cannot be copied out.

                    I've been getting similar behavior under OSX everytime I try to save a file
                    to a flash card or the 128mb USB memory thingie on my key ring.

                    I never had these problems, nor saw any of these nonsensical folders and
                    spurious strange documents under OS 9.

                    Can someone _please_ explain what on Earth is going on?

                    TIA,
                    Ken N.
                  • Ken Norris (dialup)
                    Hi Chilton, ... When I copy a file to the flash card or the USB external memory keyring module, these spurious folders and files (even including Graphic
                    Message 9 of 18 , Aug 1, 2004
                    View Source
                    • 0 Attachment
                      Hi Chilton,

                      on 8/1/04 4:45 PM, Chilton Webb at chilton@... wrote:

                      > I'm a bit confused here. Are you saying these files
                      > (TheVolumeSettingsFolder) are in the stuffed file once it decompresses,
                      > or on the flash card itself prior to decompressing it?

                      When I copy a file to the flash card or the USB external memory keyring
                      module, these spurious folders and files (even including Graphic
                      Converter.dat files) none of which have anything to do with anything I can
                      see, end up in there as well. In this case they come over with the .sit file
                      I dragged onto the flash card.

                      Right now, in the CF card, there is a locked empty folder named "Desktop
                      Folder", and another locked folder named "TheVolumeSettingsFolder". Inside
                      that is another folder with exactly the same name. And inside that is a
                      charcoal black document icon that has yet the same name again.

                      I did not put any of those there. AFAIK the OS did it all by itself. I'm
                      totally mystified.

                      3 Q's:

                      1) What are these things?

                      2) Why is this happening?

                      3) How do I unlock the folders so I can trash them?

                      I'm afraid to try to copy any of my SC files or anything else to external
                      media. This is a pain :-(

                      TIA,
                      Ken N.
                    • Dan Berghult
                      ... me Hi, I havn t used any USB-media but I think I remember that the USB drives might start behave curious if they have been used in a PC. Try to reformat
                      Message 10 of 18 , Aug 2, 2004
                      View Source
                      • 0 Attachment
                        >1) What are these things?
                        >
                        >2) Why is this happening?
                        >
                        >3) How do I unlock the folders so I can trash them?
                        >
                        >I'm afraid to try to copy any of my SC files or anything else to external
                        me



                        Hi,

                        I havn't used any USB-media but I think I remember that the USB
                        drives might start behave curious if they have been used in a PC. Try
                        to reformat the USD drive.


                        Dan

                        --
                        -------------------------------------------------------------------------
                        R2 - Coming to a future near you
                        Download it from:
                        http://www.reconnector.com
                        -------------------------------------------------------------------------


                        Dan Berghult
                        Infomaker
                        Sweden
                        dan.berghult@...
                        Phone: +46 60 66 89 00
                        Mobile: +46 70-698 68 68
                        Fax: What is that?
                        Web: http://www.infomaker.se
                      • Ken Norris (dialup)
                        Hi Dan, ... Thanks for the heads-up. The problem isn t with the USB miidrive but with the CF card. I use it to transfer data between the PB on my boat and the
                        Message 11 of 18 , Aug 2, 2004
                        View Source
                        • 0 Attachment
                          Hi Dan,

                          on 8/2/04 2:09 AM, Dan Berghult at dan.berghult@... wrote:

                          > I havn't used any USB-media but I think I remember that the USB
                          > drives might start behave curious if they have been used in a PC. Try
                          > to reformat the USD drive.

                          Thanks for the heads-up. The problem isn't with the USB miidrive but with
                          the CF card. I use it to transfer data between the PB on my boat and the G4
                          at my studio. It looks like OSX is causing the problem, because it doesn't
                          do it when I copy files from the PB (OS 9) to the media, only when I copy
                          files from the G4 (OS 10.3.4) to the media

                          Therefore, for what reasons I have no clue, Panther with Stuffit is throwing
                          these spurious "TheVolumeSettingsFolder" folders onto the media along with
                          the files, and if I do it from the Desktop, it also throws an emty folder
                          named "DesktopFolder" on there as well.

                          I need for this to stop happening, but I can't find the cause, so far am
                          unable to fix it, can't trash the folders becaose they're locked, even
                          though some appear to have nothing in them, or weird-looking black documents
                          which are unopenable.

                          Can some one give me a walk-through list for reformatting these media under
                          either OS?

                          TIA,
                          Ken N.
                        • onetriadrr
                          ... Hey Ken, From my experience, moving removable media between OS9 and X can also cause OSX invisibles to become permanently visible. The desktop folder is
                          Message 12 of 18 , Aug 2, 2004
                          View Source
                          • 0 Attachment
                            --- In SuperCard@yahoogroups.com, "Ken Norris (dialup)" <pixelbird@i...> wrote:
                            > Hi Dan,
                            >
                            > on 8/2/04 2:09 AM, Dan Berghult at dan.berghult@i... wrote:
                            >
                            > > I havn't used any USB-media but I think I remember that the USB
                            > > drives might start behave curious if they have been used in a PC. Try
                            > > to reformat the USD drive.
                            >
                            Hey Ken,

                            From my experience, moving removable media between OS9 and X can also cause OSX
                            invisibles to become permanently visible.
                            The desktop folder is always visible on non-boot volumes on my machine.

                            Are all the folders locked when mounted on both OS9 & X machine?

                            >
                            > Therefore, for what reasons I have no clue, Panther with Stuffit is throwing
                            > these spurious "TheVolumeSettingsFolder" folders onto the media along with
                            > the files, and if I do it from the Desktop, it also throws an emty folder
                            > named "DesktopFolder" on there as well.
                            >
                            > I need for this to stop happening, but I can't find the cause, so far am
                            > unable to fix it, can't trash the folders becaose they're locked, even
                            > though some appear to have nothing in them, or weird-looking black documents
                            > which are unopenable.

                            The OS is always going to populate a disk special invisible items.
                            Other apps might also add invisible items without your knowing as well.
                            If you move the media between OS's those invisible items will likly become visable again.
                            Nature of the beast.

                            If you were to tell the finder to show invisible items, via the Coctail utility for instance, you
                            would see a bunch of new stuff show up on your OSX drives.

                            > Can some one give me a walk-through list for reformatting these media under
                            > either OS?

                            Probably erase from the special menu under OS9 or Disk Utility under OSX.
                            I don't use flash disks, so just a guess.

                            > TIA,
                            > Ken N.
                          • Greg McIlhiney
                            Ken, I m not nearly the technical guru I was under 9, but I m sure others will correct me if I am wrong here :) Not sure where your problem lies. Are you able
                            Message 13 of 18 , Aug 2, 2004
                            View Source
                            • 0 Attachment
                              Ken,

                              I'm not nearly the technical guru I was under 9, but I'm sure others
                              will correct me if I am wrong here :)

                              Not sure where your problem lies. Are you able to de-compress the
                              stuffit file and get your project out?

                              Or are you objecting to these spurious files appearing on the disk?

                              X and 9 are completely different OS with different file structures.
                              When either OS reads a disk that has been touched by the other OS it
                              will attempt to translate the files/structure of the old OS to its
                              structure.

                              OS 9 has a hidden folder named Desktop Folder which of course you
                              don't see when viewed in 9... you see the contents of that folder on
                              your OS 9 desktop.

                              But when that same disk is viewed in X, that folder is not special.
                              It is not hidden and appears as a normal folder to X. OS X doesn't
                              use "Desktop Folder" for its desktop, but it does exist on the disk
                              so it is displayed.

                              TheVolumeSettingsFolder is another hidden folder to 9. You're likely
                              when viewing a disk in X to see that too... but I think in this case
                              this will appear as a file not a folder to X?

                              When viewing the disk in 9 you are likely to see X structure files
                              like .DS_Store. In X any file that starts with a period is hidden,
                              but in 9 you see them. I constantly have PC users ask me what are
                              those .DS_Store files for... until I found a utility to delete these
                              :)

                              DesktopFolder in 9, I believe, are files that you copied to the disk
                              from the desktop of your account in X.

                              >I need for this to stop happening, but I can't find the cause, so far am
                              >unable to fix it, can't trash the folders becaose they're locked, even
                              >though some appear to have nothing in them, or weird-looking black documents
                              >which are unopenable.

                              You can't stop this from happening because the two versions need to
                              do this to work with each other.

                              You probably can delete them by setting the proper permissions in X
                              (or format the drive), but they'll re-appear when you move between 9
                              & X later... so why bother.

                              I think it is more a matter of learning WHERE the files reside on the
                              disk when viewed in the two versions. If you can find your files,
                              copy them to the HD, and use them, then there shouldn't be any
                              problems.

                              You might also consider sending the file to yourself or uploading/downloading.

                              Which leads back to the first question... you were able to find the
                              stuffit archive and de-compress it to get your project, right?

                              Hope this is of some use,

                              -- greg
                            • onetriadrr
                              ... returned UTF8. I ve only been able to parse the returned pnot data with about 90% accura= cy. Thanks for the tip! DCS
                              Message 14 of 18 , Aug 3, 2004
                              View Source
                              • 0 Attachment
                                --- In SuperCard@yahoogroups.com, Tomas Franzén <tomas@l...> wrote:
                                > On 2004-08-01, at 11.37, onetriadrr wrote:
                                > > I'm trying to resolve a need to read resources of any type into SC as
                                > > text.
                                >
                                > I think you could do something like this:
                                >
                                > 1. Copy the resource in question to the project's (or another proj's)
                                > data fork as a star resource. This should be possible with CopyResource
                                > from XTend.
                                > 2. Use the startest external from the Internals Toolbox samples to read
                                > the data from the star resource.
                                >

                                Tom,
                                I'm going to give this a try.
                                Reading binary data via the Tclresource shell strips nulls and data must be=
                                returned UTF8.
                                I've only been able to parse the returned 'pnot' data with about 90% accura=
                                cy.

                                Thanks for the tip!

                                DCS
                              • Greg McIlhiney
                                ... Not the folders, just a utility to remove .DS_Store files from folders I am going to distribute to others. It is DS_Store Cleaner, but I don t see this
                                Message 15 of 18 , Aug 3, 2004
                                View Source
                                • 0 Attachment
                                  >Thanks for the info. What utility did you use toget rid of the spurious
                                  >folders?

                                  Not the folders, just a utility to remove .DS_Store files from
                                  folders I am going to distribute to others. It is DS_Store Cleaner,
                                  but I don't see this solving your problems.


                                  >The problem is that it keeps adding more and nesting "TheVolumesFolder"
                                  >folders everytime I copy files onto it, taking up more space each time.
                                  >These are visible on both OS'.

                                  At 8:58 AM -0800 8/2/04, Ken Norris (dialup) wrote:
                                  >The problem isn't with the USB miidrive but with
                                  >the CF card. I use it to transfer data between the PB on my boat and the G4
                                  >at my studio.

                                  I can't re-create your problem when moving from 9 to X using my Flash
                                  USB device and I've formatted on both 9 and X in varying formats.

                                  But what is a CF card?

                                  Do you get the same problems using a USB Flash drive?

                                  -- greg
                                • Ken Norris (dialup)
                                  Hi Greg, Thanks for the info. What utility did you use toget rid of the spurious folders? The problem is that it keeps adding more and nesting
                                  Message 16 of 18 , Aug 3, 2004
                                  View Source
                                  • 0 Attachment
                                    Hi Greg,

                                    Thanks for the info. What utility did you use toget rid of the spurious
                                    folders?

                                    The problem is that it keeps adding more and nesting "TheVolumesFolder"
                                    folders everytime I copy files onto it, taking up more space each time.
                                    These are visible on both OS'.

                                    on 8/2/04 10:45 AM, Greg McIlhiney at greg@... wrote:

                                    > Which leads back to the first question... you were able to find the
                                    > stuffit archive and de-compress it to get your project, right?

                                    No. It's in one of the locked folders and won't copy onto the HD.

                                    I can't email to myself from the studio, where I'm doing all my work,
                                    because there is no internet link yet. I will have to wait until after hours
                                    to use my friends' machine.

                                    This is making a bigger hassle than I planned.

                                    Ken N.
                                  • Ken Norris (dialup)
                                    Howdy, ... Yep. And it adds more (taking up more space, albeit not a whole lot, but they will add up after awhile) each time I copy to the media, and sometimes
                                    Message 17 of 18 , Aug 3, 2004
                                    View Source
                                    • 0 Attachment
                                      Howdy,

                                      on 8/2/04 10:37 AM, onetriadrr at one@... wrote:

                                      > Are all the folders locked when mounted on both OS9 & X machine?

                                      Yep. And it adds more (taking up more space, albeit not a whole lot, but
                                      they will add up after awhile) each time I copy to the media, and sometimes
                                      nests them one inside the other.

                                      I'm doing this a lot because I have no internet at my studio yet (can't mail
                                      the files).

                                      Thanks so much for the time to look at the problem.

                                      Ken N.
                                    • Ken Norris (dialup)
                                      Hi Greg, ... Compact Flash cards. The most common media for digital cameras, similar to Smart Cards and Sony Memory Sticks. But they ve been great for
                                      Message 18 of 18 , Aug 3, 2004
                                      View Source
                                      • 0 Attachment
                                        Hi Greg,

                                        on 8/3/04 10:13 AM, Greg McIlhiney at greg@... wrote:

                                        > But what is a CF card?

                                        Compact Flash cards. The most common media for digital cameras, similar to
                                        Smart Cards and Sony Memory Sticks. But they've been great for transporting
                                        files between disconnected machines 'til now. You can get them with much
                                        more space (up to 1 gig) than a Zip disk at 1/4 the physical size. But a 1g
                                        flash card is about $650 last time I looked. You just about have to be a
                                        professional photojournalist to justify that kind of expense. OTOH, you can
                                        get 128mb ones on sale at Costco for under $40

                                        I have a formatted 128mb SanDisk Compact Flash card I use for VM on my PB
                                        1400. Slow as molasses (fast searches, slow throughput), but keeps it from
                                        crashing.
                                        >
                                        > Do you get the same problems using a USB Flash drive?

                                        Basically, yes.

                                        Ken N.
                                      Your message has been successfully submitted and would be delivered to recipients shortly.