Re: Scripting Console
Re: Scripting Console
- Subject: Re: Scripting Console
- From: Johnny AppleScript <email@hidden>
- Date: Wed, 22 Sep 2004 17:45:15 -0600
Title: Re: Scripting Console
Greetings Bernardo,
On 04/09/22 6:26 AM, "Bernardo Hoehl / Gessos Rutenium" <email@hidden> wrote:
> I am trying to to make it open Console app to display the progress of the
> process, a way of showing the GUI user that my application is working. But it
> seems to me that Console doesn't have an applescript dictionary.
>
> This is my code so far:
>
> tell application "Console"
> open "/var/log/mail.log"
> end tell
Better is to use:
tell application "System Events" to open file ":var:log:mail.log"
>
> I would like to set the console window to a specific syze and position in the
> screen, so that it won't open on top of my window, looking like just another
> window of my own program.
For this I would precede the above 'open file' command with a 'defaults write' shell script:
(* to get the desired coordinates in the first place, just open, set the position of, and close the desired window, then run: *)
set winPrefs to do shell script "defaults read ~/Library/Preferences/com.apple.console | grep /var/log/mail.log | grep NSWindow"
return winPrefs
set qt to "\""
do shell script "defaults write ~/Library/Preferences/com.apple.console " & qt & "NSWindow Frame /var/log/mail.log" & qt & " " & qt & "676 542 400 376 0 0 1280 1002" & qt
tell application "System Events" to open file ":var:log:mail.log"
Just be aware that different users have different screen resolutions, prefs, etc.; be careful when dictating window sizes and placement; and you’d better think about letting the user give the desired placement a memory of its own, rather than you always dictating it.
HTH
JA
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >Scripting Console (From: Bernardo Hoehl / Gessos Rutenium <email@hidden>) |