Your best friend for file transfer.

Fetch application logoFetch

Fetch window positioning (4 posts)

  • Started 5 years ago by JImBrandt
  • Latest reply 5 years ago from Jim Matthews
  • JImBrandt Member

    Jim,

    I'm working on an Applescript that positions multiple transfer windows to specific sets of coordinates. It's not behaving the way I'm expecting.

    So I put together a simple example.

    I open a Fetch transfer window and position it anywhere on the screen.

    I then run this script:

    tell application "Fetch" to set TWBounds to bounds of transfer window 1
    set {x0, y0, x1, y1} to TWBounds
    set NewBounds to {35, 150, 755, 525}
    tell application "Fetch" to set bounds of transfer window 1 to NewBounds

    The first two lines are just so I can see what the existing coordinates are.

    After running the script, the bounds of the window are {35, 150, 755, 513}, not what I expected of {35, 150, 755, 525}.

    So I thought maybe it was something inherent in the bounds of the window that I was missing.

    So I replaced Fetch with Finder and transfer window with Finder window, giving me:

    tell application "Finder" to set TWBounds to bounds of Finder window 1
    set {x0, y0, x1, y1} to TWBounds
    set NewBounds to {35, 150, 755, 525}
    tell application "Finder" to set bounds of Finder window 1 to NewBounds

    and opened a Finder window on the screen. The bounds of the Finder window after running the script are the expected {35, 150, 755, 525}.

    So, my question is, why in Fetch can I not set all four coordinates to exactly what I want? Why is the last coordinate coming out 8 pixels less than what I asked for?

    While it seems like a minor point, I'm testing these coordinates against predetermined values and they're not matching up after setting the bounds, causing my comparison to fail every time, when 3 of the four are matching up.

    Posted 5 years ago #

  • Jim Matthews Administrator

    Hi Jim,

    Fetch restricts the height of transfer windows to values that let it show an integral number of file list rows (i.e. no partial rows). The height you are asking for would result in a partial row, so Fetch rounds it down.

    Thanks,

    Jim Matthews
    Fetch Softworks

    Posted 5 years ago #

  • JImBrandt Member

    So, how do I compute the number so I can do a comparison on the bounds values?

    I'm trying to stack the Fetch windows in such a way as I can see the progress circles on all the windows while showing up to20 windows on the screen and need to test the values do determine if they need adjusted or not.

    Posted 5 years ago #

  • Jim Matthews Administrator

    I would set the bounds to what you want them to be, and let Fetch round the heights down as necessary. That will leave a bit of space between windows. If you don't want to leave that space, read the bounds after you set it in order to determine where you should position the next window down.

    Thanks,

    Jim Matthews
    Fetch Softworks

    Posted 5 years ago #

Reply

  • Or nickname, if you prefer.
  • This will be kept confidential.
  • This is to ensure that you’re a person, not a spambot.