Re: Please Help
Re: Please Help
- Subject: Re: Please Help
- From: Michael Terry <email@hidden>
- Date: Mon, 10 Jun 2002 01:58:32 -0700
On 6/9/02 7:20 AM, "charles.lindsay" <email@hidden> wrote:
>
...is it possible to change the line :-
>
>
set theContainer to choose folder with prompt "Choose the folder where you
>
want to store " & theReportName & ""
>
>
so that theContainer is saved onto a mounted volume called IT_TEST in a
>
folder called AUDIT
Do you mean you just want to just want to put the path to the saved report
directly into the script sans user interaction? Sure, just replace the first
line with:
property theContainer : alias "IT_TEST:AUDIT:"
So now your script would look like this:
======================================================================
(* set the folder to save the report *)
property theContainer : alias "IT_TEST:AUDIT:"
(* choose a name for the report *)
set theReportName to computer name
(* choose where to save the report *)
(* This line is unnecessary now *)
--set theContainer to choose folder with prompt "Choose the folder
[NO-BREAK]where you want to store " & theReportName & ""
(* create empty file for ASP to write the report to *)
tell application "Finder"
set theLocation to (make file at theContainer with properties
[NO-BREAK]{name:theReportName}) as alias
end tell
tell application "Finder"
activate
select disk "IT_TEST"
end tell
tell application "Apple System Profiler"
activate
set SysReport to (make new report at beginning with properties
[NO-BREAK]{report view format:text, report contents:{control panels,
[NO-BREAK]extensions, applications, system profile}})
save SysReport in theLocation
quit
end tell
======================================================================
[formatted using ScriptToEmail - gentle relief for mailing list pains]
[
http://files.macscripter.net/ScriptBuilders/ScriptTools/ScriptToEmail.hqx]
ScriptToEmail will also decode its special formatting, if it's too much
trouble to do by hand!
A couple notes. That second Finder block seems extraneous. I can't see that
those lines do anything useful. At the very least you can include all the
Finder commands in one 'tell' block.
Also, this will do the job, but only if you can be sure that the target
volume will always be mounted and that previous ASP reports will have been
removed from the save location. Otherwise it will break. If you can't be
sure of these environment variables, then you should implement some simple
error checking, such as mounting the target volume if necessary and clearing
out old reports.
If I've misunderstood your request, please reply with greater specificity.
Cheers,
Mike
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
References: | |
| >Please Help (From: "charles.lindsay" <email@hidden>) |