Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Can't double-click rebol scripts on iMac

 [1/15] from: al:bri:xtra at: 26-Aug-2002 16:54


Sabin Densmore wrote:
> The trouble I've found -- this weekend trying to automate some file
handling tasks on my iMac -- is that Rebol is not native to each OS. An instance of Rebol has to be running in order to execute the .r scripts -- or am I missing something?
> I ended up using Applescript, because it would run on double-click from
the desktop. Same with some apps I'm working on for windows -- Rebol has to be running to launch the apps.
> Is there a way around this?
There has to be an association in the operating system between files with the extension ".r" and the Rebol interpreter. With this association, the iMac operating system will automatically launch Rebol and "give it" the file that's been double clicked on. The association is usually created when Rebol/View is installed, but not for Rebol/Core. Perhaps you could try installing Rebol/View on your iMac? I hope that helps! Andrew Martin ICQ: 26227169 http://valley.150m.com/

 [2/15] from: joel:neely:fedex at: 26-Aug-2002 7:41


Hi, Andrew, Andrew Martin wrote:
> There has to be an association in the operating system between > files with the extension ".r" and the Rebol interpreter. >
No. You're describing the Visual CP/M method, not the standard MacOS mechanism. With MacOS, the directory entry of each file has two attributes "creator" and "file type" which are normally set by the application that creates the file. The "creator" attribute tells which application to launch when the file is double-clicked (usually the creating application itself), and the "file type" allows an application to have multiple "flavors" of documents (e.g. end-user documents vs. read-only templates) that it treats differently. Doing this with a one-to-three-letter suffix on the file name itself is a very fragile substitute used by some big company in Redmond, based on legacy designs going back at least to the early 1970's. It's very easy for the user to change the suffix accidentally while renaming a file, and then the relationship is broken.
> With > this association, the iMac operating system will automatically > launch Rebol and "give it" the file that's been double clicked > on. The association is usually created when Rebol/View is > installed, but not for Rebol/Core. > > Perhaps you could try installing Rebol/View on your iMac? >
I don't know what OS is running on Sabin's system, but View is not yet available for MacOS/X; it's been marked "pending" on the RT web site for a long time. I've been watching for it, as my main laptop these days is an iBook running OS/X. I'm thoroughly happy with it except for the fact that I'm excluded from doing anything in View. I normally work on a combination of MacOS, w2k, w95, Solaris, and a little HP-U/X, so I try to avoid becoming dependent on anything that I can't use across all platforms. -jn- -- ; Joel Neely joeldotneelyatfedexdotcom REBOL [] do [ do func [s] [ foreach [a b] s [prin b] ] sort/skip do function [s] [t] [ t: "" foreach [a b] s [repend t [b a]] t ] { | e s m!zauafBpcvekexEohthjJakwLrngohOqrlryRnsctdtiub} 2 ]

 [3/15] from: petr:krenzelok:trz:cz at: 26-Aug-2002 15:38


Joel Neely wrote:
>Hi, Andrew, >Andrew Martin wrote:
<<quoted lines omitted: 18>>
>accidentally while renaming a file, and then the relationship >is broken.
And I think Mac OS should look at AmigaOS tooltypes and datatypes, which recognize file under internal structure etc. :-) No, really - just kidding - so what would Rebol would have to do, to support MacOS properly? -pekr-

 [4/15] from: g:santilli:tiscalinet:it at: 26-Aug-2002 16:31


Hi Joel, On Monday, August 26, 2002, 2:41:08 PM, you wrote: JN> MacOS mechanism. With MacOS, the directory entry of each file JN> has two attributes "creator" and "file type" which are normally JN> set by the application that creates the file. The "creator" What happens when you download a file from the Internet? On the AmigaOS, such information is kept in the icon file. You can click on the icon and press Amiga-I to edit it. (BTW, why, being Win the only broken OS when it comes to file types, do people tend to follow it --- even on Linux? The whole world seems to rely on file extensions... This is likely the result of people never having seen anything except Win... I wonder how come there's only so few people really realizing the (cultural) disaster MS has created...) Regards, Gabriele. -- Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r

 [5/15] from: joel:neely:fedex at: 26-Aug-2002 10:49


Hi, Gabriele, Gabriele Santilli wrote:
> What happens when you download a file from the Internet? >
Mac files are usually exchanged across the 'Net using a tool such as Stuffit, which creates a single data file containing all of the necessary components: 1) data fork 2) resource fork 3) creator code 4) file type code and can reconstitute them when the file is "unstuffed" on the receiving side. Since "stuffing" a file also compresses it, the whole process is a net win and just as painless as using gzip on Unix.
> (BTW, why, being Win the only broken OS when it comes to > file types, do people tend to follow it --- even on Linux?
<<quoted lines omitted: 3>>
> people really realizing the (cultural) disaster MS has > created...)
I believe you've hit the correct explanation. It's bitterly ironic that a company that has turned "innovation" into a bit of newspeak marketing jargon actually stifles innovation by hanging on to seriously outdated concepts and by attempting to kill off any attempt at legitimate competition. -jn-

 [6/15] from: g:santilli:tiscalinet:it at: 26-Aug-2002 19:19


Hi Joel, On Monday, August 26, 2002, 5:49:18 PM, you wrote: JN> Mac files are usually exchanged across the 'Net using a tool such JN> as Stuffit, which creates a single data file containing all of the JN> necessary components: So it's not a big deal, as long as you --- the developer --- can tell MacOS that that file should be opened by REBOL and not by your editor. What's the problem for the user? (I'm really asking, since I don't know MacOS that much.) Regards, Gabriele. -- Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r

 [7/15] from: joel:neely:fedex at: 26-Aug-2002 16:42


Hi, Gabriele, Gabriele Santilli wrote:
> JN> Mac files are usually exchanged across the 'Net using a tool > JN> such as Stuffit, which creates a single data file containing > JN> all of the necessary components: >
And, of course, before Stuffit there was BinHex...
> So it's not a big deal, as long as you --- the developer --- > can tell MacOS that that file should be opened by REBOL and > not by your editor. What's the problem for the user? >
I assume your talking about the scenario where a "developer" writes a script and gives it to a "user" who is expected to double-click on it to run as needed but not expected to modify the content of the script file. I'm running OS/X on my iBook, so I don't have ready access to try an experiment on older (non-X) MacOS versions. The key questions would be: 1) What is the creator/application code for REBOL/Core? 2) Is there a different creator/application code for /View? 3) If someone uses a utility to change the creator code for a file of type "TEXT" from whatever editor created it to the creator code for /Core or /View, will REBOL (either version) know to DO that file once launched? 4) If REBOL (either /View or /Core) creates a file, what creator and type codes will the directory contain for that file? If anyone has ready access to a non-X MacOS with a utility such as BBEdit (which can manipulate creator/type codes), the above could be answered fairly quickly. If the answer to (3) is "Yes", and the answer to (4) is that the creator is set to the appropriate version of REBOL and the type is left as something else that REBOL will accept per question (3) then a REBOL one-liner could be written to a) read a specified text file (assumed to be a script) b) write it to another name (implicitly marking it with REBOL as the creator) and the output would cause REBOL to launch and run when double- clicked. Needless to say, all of this is speculative, contingent, and disclaimered six ways from Sunday... ;-) -jn-

 [8/15] from: nitsch-lists:netcologne at: 27-Aug-2002 0:19


On Mon, Aug 26, 2002 at 07:19:45PM +0200, Gabriele Santilli wrote:
> Hi Joel, > On Monday, August 26, 2002, 5:49:18 PM, you wrote:
<<quoted lines omitted: 5>>
> your editor. What's the problem for the user? (I'm really asking, > since I don't know MacOS that much.)
Know only oold macs. there each file knows its programm, there is no distinction by type. a normal web-server does not tell this special info. but if you do [write %file.r read %file.r] rebol adds this information afaik. so maybe a script to search directories and patch *.r-scripts could help. also rebol has special modes to access mac-forks and should be able to set the start-programm explicitely. but then modern macs should have settings somewhere how to associate mime-types/file-extensions from foreign systems? find and change them..
> Regards, > Gabriele. > --
-volker

 [9/15] from: joel:neely:fedex at: 27-Aug-2002 6:19


Hi, Volker, Volker Nitsch wrote:
> Know only oold macs. there each file knows its programm, > there is no distinction by type... >
Both creator and type information have been in the MacOS file system at least since the mid-80's, if not from the very beginning. I did Mac development in that time frame (e.g., GUI-driven barcode label printing software), and used the file type distinction (e.g., to handle label design files differently from content data files). As I mentioned earlier in this thread, this information was not exposed to the end user directly. However, it was detectable, e.g. when MacWrite saved a document as "TEXT" versus native MacWrite format, a different icon was used for the document. -jn- -- ; Joel Neely joeldotneelyatfedexdotcom REBOL [] do [ do func [s] [ foreach [a b] s [prin b] ] sort/skip do function [s] [t] [ t: "" foreach [a b] s [repend t [b a]] t ] { | e s m!zauafBpcvekexEohthjJakwLrngohOqrlryRnsctdtiub} 2 ]

 [10/15] from: albertgeluk:optushome:au at: 28-Aug-2002 22:32


The file Type and Creator for Rebol View does not appear to be registered with Apple. I have written many Rebol View scripts for OS9.x and Windows, but have never been able to "Double Click" on any Rebol script to activate it. (This is on any non OS/X). I have always used the rebol desktop to initiate a rebol script on a Mac. This is one of the reasons I have used Applescript in many instances because, most Mac users only know how to "Double Click". If anyone knows of an existing file Type and Creator for non-OS/X, life would be much simpler. (Yes Rebol is far more efficient than Applescript!) Regards, Albert Geluk

 [11/15] from: carl:cybercraft at: 29-Aug-2002 21:08


On 29-Aug-02, Albert Geluk wrote:
> The file Type and Creator for Rebol View does not appear to be > registered with Apple.
registered ??? You have to /ask/ Apple to have a file-type registered just so the files can be launched from an icon??? I've misunderstood here, right?
> I have written many Rebol View scripts for OS9.x and Windows, but > have never been
<<quoted lines omitted: 8>>
> Regards, > Albert Geluk
-- Carl Read

 [12/15] from: joel:neely:fedex at: 29-Aug-2002 8:48


Hi, Carl, There are two answers to your question: 1) TECHNICALLY: No, you can simply set the creator/type codes within your application's resource bundle. When it creates files, their creator/type can be set to whatever you wish. When your application is dropped into the file system the desktop database will be updated based on information in your app's resource fork. 2) POLITICALLY/CONVENTIONALLY: It is considered good manners to coordinate the creator/type codes you want to use. Otherwise you get the same sort of nonsense that we see in Visual CP/M, where selection of three-letter "extensions" is a free-for-all and it is quite common for a newly-installed app to grab ownership of types that you've been using with a previously-installed app (or for an OS upgrade to grab ownership of types formerly used by applications that m*cr*s*ft wants to put out of business. -jn- ----- Original Message ----- From: Carl Read <[carl--cybercraft--co--nz]> Date: Thursday, August 29, 2002 4:08 am

 [13/15] from: anton:lexicon at: 30-Aug-2002 0:37


I am not a mac person for a long time, but I found with a little searching a shareware program that does what you need. Go here for "Default App": http://www.merzwaren.com/da/ Near the bottom of this page, it has an option "Use File Extension Mappings". See if it works for you. I got there via this programmer's site: http://www.tempel.org/macdev/ Anton.

 [14/15] from: dada:gecko:verizon at: 29-Aug-2002 11:26


It's great that there's a shareware app for doing that. Cool. However, I still wonder if there is some way to build an application in Rebol and then have people grab the OS-specific version -- mac OS, mac OSX, amiga, pc, *nix -- of that app, and use it without any other work necessary on their part. Is there? I'm relatively new to this whole rebol world. Thanks, sd Anton wrote:
> I am not a mac person for a long time, > but I found with a little searching a
<<quoted lines omitted: 103>>
>>subject, without the quotes. >>
-- striving to be unlike gregor samsa : [sabin--onegecko--com] : www.onegecko.com

 [15/15] from: carl:cybercraft at: 30-Aug-2002 11:19


On 30-Aug-02, Joel Neely wrote:
> Hi, Carl, > There are two answers to your question:
<<quoted lines omitted: 4>>
> database will be updated based on information in your app's > resource fork.
But REBOL doesn't create the files - Joe ABC did on the other side of the planet using a text-editor on OS XYZ. Is there no way to just select a text-file and give it a non-text creator/type so its application can be whatever you want?
> 2) POLITICALLY/CONVENTIONALLY: It is considered good manners to > coordinate the creator/type codes you want to use. Otherwise
<<quoted lines omitted: 4>>
> OS upgrade to grab ownership of types formerly used by applications > that m*cr*s*ft wants to put out of business.
Maybe all true. But why is it that my PC-using friends don't seem to have had any trouble setting up Windows to launch REBOL scripts with just a click on the scripts' icons while the Mac user with his better OS can't? -- Carl Read

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted