• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Scripting Console
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Scripting Console
      • From: Bernardo Hoehl / Gessos Rutenium <email@hidden>
References: 
 >Scripting Console (From: Bernardo Hoehl / Gessos Rutenium <email@hidden>)

  • Prev by Date: Re: whose statement in FMP 7
  • Next by Date: Re: IS: Debugging Techniques -- WAS: Re: cure for NSArgumentEvaluationScriptError?
  • Previous by thread: Re: Scripting Console
  • Next by thread: Re: Scripting Console
  • Index(es):
    • Date
    • Thread