[jawsscripts] Re: Moving files with scripts

  • From: Doug Lee <doug.lee@xxxxxxxxxxxxxxxx>
  • To: jawsscripts@xxxxxxxxxxxxx
  • Date: Wed, 8 Jun 2011 06:13:13 -0400

There's no need to assign null (or equivalent) to a local variable,
but there is a point to assigning that to globals because otherwise
they never get cleared until you unload JAWS.  That said, I often
forget to include in my AutoFinishEvents the clearing of globals,
unless there's a functional reason they need to be cleared, such as
when they're hanging onto a huge COM object, like a copy of Word for
example.

On Wed, Jun 08, 2011 at 10:56:24AM +0100, Martin Slack wrote:
Hi John,

  Sorry about the delay in answering.  In VBScript itself, there is an 
object called Nothing, which can be assigned to any object to free all of 
the resources which have previously been assigned to that object.  Having 
the object oNull with essentially no contents is the analogous formulation 
in Jaws scripting.  I'm not sure that anyone outside FS knows enough about 
how Jaws script is implemented to be sure whether this freeing of resources 
actually happens, but what harm can it do to try?

  Corrections welcome,

  Martin


----- Original Message ----- 
From: "John Robichaud" <john_robichaud@xxxxxxxxxxx>
To: <jawsscripts@xxxxxxxxxxxxx>
Sent: Tuesday, June 07, 2011 5:04 PM
Subject: [jawsscripts] Re: Moving files with scripts


> Martin,
> Thank you for your very helpful code. Can you explain the need for the 
> "tidy
> up" code? The oNull object is declared in the beginning but it isn't set 
> to
> any value. What is its actual purpose in the line: Let oFile1 = oNull
> John Robichaud
>
>
> -----Original Message-----
> From: jawsscripts-bounce@xxxxxxxxxxxxx
> [mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Martin Slack
> Sent: Sunday, June 05, 2011 3:01 PM
> To: JAWSScripts
> Subject: [jawsscripts] Re: Moving files with scripts
>
> John,
>
>  Here is a Jaws script which uses the Scripting.FileSystemObject to copy a
> file to another folder.  I notice that the Copy method will not create a
> folder, so you need to do that first, but the Scripting.FileSystemObject 
> has
> a CreateFolder method.  Also note that the paths need to have their
> backslashes escaped for Jaws.
>
> Martin
>
> Script test ()
> Var
>  Object oNull,
>  Object oSystem,
>  Object oFile1,
>  Object oFile2
>
>
> Let oSystem =CreateObject("Scripting.FileSystemObject")
>
> ;create a file and write some text into it Let oFile1 =
> oSystem.CreateTextFile("c:\\testfile.txt", 1) SayString ("Writing file")
> oFile1.Write ("This is a test.") oFile1.Close
>
> ;get the existing file and copy to an existing folder Let oFile2 =
> oSystem.GetFile("c:\\testfile.txt")
> SayString ("Copying file to c:\temp")
> oFile2.Copy ("c:\\temp\\testfile2.txt")
> oFile2.Close
>
> ; tidy up
> Let oFile1 = oNull
> Let oFile2 = oNull
> Let oSystem = oNull
> EndScript
>
> ----- Original Message -----
> From: "John Robichaud" <john_robichaud@xxxxxxxxxxx>
> To: <jawsscripts@xxxxxxxxxxxxx>
> Sent: Friday, June 03, 2011 10:44 PM
> Subject: [jawsscripts] Re: Moving files with scripts
>
>
>> Soronel,
>> I'm experimenting with the FileSystemObject but having trouble 
>> translating
>> the VBSCript code to Jaws. Can you give me an example in Jaws script of
>> copying a file from one folder to another?
>> John Robichaud
>>
>> -----Original Message-----
>> From: jawsscripts-bounce@xxxxxxxxxxxxx
>> [mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Soronel Haetir
>> Sent: Friday, May 27, 2011 9:51 AM
>> To: jawsscripts@xxxxxxxxxxxxx
>> Subject: [jawsscripts] Re: Moving files with scripts
>>
>> You can use the filesystem objects to do that sort of thing, take a look
>> at
>>
>> http://msdn.microsoft.com/en-us/library/6kxy1a51.aspx
>>
>> You can get an instance of the FileSystem object with a call to the jaws
>> CreateObject function:
>>
>> Object objFileSystem
>> ...
>> let objFileSystem = CreateObject("Scripting.FileSystemObject")
>>
>> From there you can use any method on the object.
>>
>> On 5/27/11, John Robichaud <john_robichaud@xxxxxxxxxxx> wrote:
>>> Is there a way in a Jaws script to manipulate files in Windows
>>> Explorer? I'd like to be able to copy a file from one folder to
>>> another and also be able to rename it.
>>> John Robichaud
>>>
>>>
>>> __________?
>>>
>>> View the list's information and change your settings at
>>> //www.freelists.org/list/jawsscripts
>>>
>>>
>>
>>
>> --
>> Soronel Haetir
>> soronel.haetir@xxxxxxxxx
>> __________?
>>
>> View the list's information and change your settings at
>> //www.freelists.org/list/jawsscripts
>>
>>
>>
>> __________???
>>
>> View the list's information and change your settings at
>> //www.freelists.org/list/jawsscripts
>>
>
> __________???
>
> View the list's information and change your settings at
> //www.freelists.org/list/jawsscripts
>
>
>
> __________???
>
> View the list's information and change your settings at
> //www.freelists.org/list/jawsscripts
> 

__________???

View the list's information and change your settings at 
//www.freelists.org/list/jawsscripts

-- 
Doug Lee, Senior Accessibility Programmer
SSB BART Group - Accessibility-on-Demand
mailto:doug.lee@xxxxxxxxxxxxxxxx  http://www.ssbbartgroup.com
"While they were saying among themselves it cannot be done,
it was done." --Helen Keller
__________�

View the list's information and change your settings at 
//www.freelists.org/list/jawsscripts

Other related posts: