externals

Brian Yennie briany at qldlearning.com
Mon Jan 19 22:13:53 EST 2009


They may have a good argument there =). There is something to be said  
for not exposing low level OS routines to a high level API. It  
prevents very messy things from happening to your machine, even at the  
hands of the "good" people.

With that said, perhaps there are other ways of approaching your  
problem. For example, suppose you want to know if a file had been  
modified with a certain name. Could you not do something like (NOTE:  
this is untested pseudo-code)

global lastCheckTime

on watchFolder tFolder
   set the directory to tFolder
   put the detailed files into tFiles
   filter tFiles with "*Randall*"
   sort tFiles by item 3 of each -- modification date
   repeat while (item 3 of line 1 of tFiles > lastCheckTime)
       put line 1 of tFiles into someFile
       doSomething someFile
       delete line 1 of tFiles
   end repeat
   put the seconds into lastCheckTime
   send "watchFolder tFolder" to this stack in 1 second
end watchFolder

All you would be doing is parsing the raw text from "the detailed  
files". You can zip through an awful lot of files in just a few  
milliseconds that way, and the file modification time is there for the  
taking. It's not an event notification, granted, but might just be a  
practical way to poll for file changes. I'm sure you could monitor  
many thousands of files this way w/o too much overhead, and it would  
work cross-platform.

> Well there is the rub.  Apple, hates the idea that somone would  
> tammie into the file level event loop.  I think the security issues  
> are scarry to a company that tells people that says its OS doesnt  
> attract malware.  I have talked to top apple OS people who act as if  
> i am hitler for even asking.
>
> Randall
>
> -----Original Message-----
> From: "Brian Yennie" <briany at qldlearning.com>
> To: "How to use Revolution" <use-revolution at lists.runrev.com>
> Sent: 1/19/2009 6:19 PM
> Subject: Re: externals
>
> I think it's probably two of those things - the OS doesn't like to
> expose certain things as much as others, and also programs like Rev
> have to pick and choose what they support. Why not do the OS level
> research, and find out how hard it would be to create an external?
>
>> Yes, I want it all!  And I want it easy.  Things like this can be
>> attacked at the application level... which would help ME... but it
>> will only help the whole rev community when it is an integral part
>> of the rev native event and command loop.  This is why I talk of
>> these things on this and other lists... to garner interest... to
>> plant seeds... to grow memes in the heads of others.
>>
>> Maybe Rev and programs like it just chase the low hanging fruit...
>> maybe this is an OS problem... maybe we live in a world where the
>> computer is a static device that waits for our commands... and maybe
>> that precludes the kinds of event driven automation that I seek.  We
>> have no experience with it so we don't ask for it.
>>
>> Randall
>>
>>
>> On Jan 19, 2009, at 1:17 PM, Brian Yennie wrote:
>>
>>> Randall,
>>>
>>> Unfortunately it seems you are looking for a high-level API to take
>>> care of a very low level job. There simply isn't an API for
>>> everything. You are probably going to have to get your hands dirty
>>> in C if this is your goal. If you know the OS APIs you want to tap
>>> into, you could work on building externals in C. If you don't, time
>>> to do some research =). You will definitely need to build separate
>>> externals for each operating system as well.
>>>
>>> Maybe not what you were hoping for, but I hope that helps.
>>>
>>>> QuickKeys is cool... but it doesn't offer finder events as
>>>> triggers for the execution of macros.  There is no way, for
>>>> instance, to tell it:
>>>>
>>>> When a user saves any file, from any application, and the name
>>>> contains "Entropy", then save an alias at "Hard Drive: My Entropy
>>>> Docs:"






More information about the use-livecode mailing list