• 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: Display content on two monitors
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Display content on two monitors


  • Subject: Re: Display content on two monitors
  • From: Christopher Stone <email@hidden>
  • Date: Tue, 13 Mar 2012 23:05:32 -0500

On Mar 13, 2012, at 13:20, Michael Ghilissen wrote:
I want to write a script that would display text content on two distinct display-monitors (each one would have a distinct content), but I don't know where to start: which scriptable application, how to address the two monitors separately,...?  The content would be refreshed regularly.
______________________________________________________________________

Hey Michael,

Hmm.  Offhand I think I'd use Smile or TextWrangler (BBEdit for me since I own it).  TextEdit could probably do the job, but I don't like scripting it much.

You can probably use 'system_profiler' in a 'so shell script' to discover your monitor parameters, but I don't presently have two monitors to test with:

 system_profiler SPDisplaysDataType

I on the other hand would use an available unix executable called 'screenresolution' for this job.

The need for this stems from the fact that Applescript itself doesn't discriminate between monitors; it considers all attached screens to be one big window.  Therefore you have to get the bounds of the desktop's window and then calculate the relative monitor spaces yourself.

Minerva:~ chris$ screenresolution get
Display 0: 1920x1200x32

tell application "Finder"
bounds of window of desktop
end tell

--> {0, 0, 1920, 1200}

Of course if your system set-up is static you can probably just position windows on each monitor as you like and then get 'bounds' for them.  Then your script can position them as necessary.

A simple example that does not account for multiple monitors but conveys the basic idea:

tell application "Smile"
set winMon1 to make new text window with properties {name:"WinMon1", bounds:{0, 22, 845, 1196}}
set winMon2 to make new text window with properties {name:"WinMon2", bounds:{1073, 22, 1918, 1196}}
set text of winMon1 to "This window should be on montior 1"
set text of winMon2 to "This window should be on montior 2"


delay 2


select winMon1
set text of winMon1 to "More goofy text on Monitor 1."


delay 2


select winMon2
set text of winMon2 to "More goofy text on Monitor 2."
end tell

That ought to get you started.

--
Best Regards,
Chris

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Display content on two monitors
      • From: Robert Poland <email@hidden>
    • Re: Display content on two monitors
      • From: Michael Ghilissen <email@hidden>
References: 
 >Triggering applescript on new mail creation in Mail app (From: Jashanjeet Singh <email@hidden>)
 >Re: Triggering applescript on new mail creation in Mail app (From: Bill Cheeseman <email@hidden>)
 >An AppleScript to start an SVN Server on boot (From: Alex Zavatone <email@hidden>)
 >Display content on two monitors (From: Michael Ghilissen <email@hidden>)

  • Prev by Date: Re: An AppleScript to start an SVN Server on boot
  • Next by Date: Re: An AppleScript to start an SVN Server on boot
  • Previous by thread: Display content on two monitors
  • Next by thread: Re: Display content on two monitors
  • Index(es):
    • Date
    • Thread