• 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
Why does 1440 not equal 1440?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Why does 1440 not equal 1440?


  • Subject: Why does 1440 not equal 1440?
  • From: Robert Poland <email@hidden>
  • Date: Thu, 04 Aug 2011 11:21:21 -0600

Hi,

This script does not work.

The file "setBounds_Monitors" contains the line '2560 1440 iMac_27"', three items separated by tabs.

I have tried creating this file with several text editors.

The display dialog shows the correct text but fails to equal.

What subtlety am I missing here?


property theDataFile : POSIX file "Library/Scripts/Universal Scripts/setBounds_Monitors" -- data file
global newR, newB

-- get screen size for monitor
tell application "Finder" to set {newL, newT, newR, newB} to bounds of window of desktop

my monitorData()
display dialog newR & " X " & newB as text

on monitorData() -- screen parameters
set originalDelimiters to AppleScript's text item delimiters
set fileData to read file theDataFile
set AppleScript's text item delimiters to {return}
-- get line of data
repeat with i from 1 to (count text items of fileData)
set currentLineItem to (text item i of fileData)
set AppleScript's text item delimiters to {tab}
# parse out application name for comparison
set temp to text item 2 of currentLineItem
display dialog temp & return & "-" & newB & "-" as text
if temp = newB then
beep
exit repeat
end if
set AppleScript's text item delimiters to {return}
end repeat


-- parse out data
set AppleScript's text item delimiters to {tab}
set newB to text item 2 of currentLineItem
set newR to text item 1 of currentLineItem
set AppleScript's text item delimiters to originalDelimiters -- reset
end monitorData


TIA,


Robert Poland - Fort Collins, CO



 _______________________________________________
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: Why does 1440 not equal 1440?
      • From: "koenig.yvan" <email@hidden>
    • Re: Why does 1440 not equal 1440?
      • From: "Mark J. Reed" <email@hidden>
  • Prev by Date: Re: SVN
  • Next by Date: Re: Why does 1440 not equal 1440?
  • Previous by thread: Re: SVN
  • Next by thread: Re: Why does 1440 not equal 1440?
  • Index(es):
    • Date
    • Thread