• 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
List Problem (I think) Disguised as a GraphicConverter Problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

List Problem (I think) Disguised as a GraphicConverter Problem


  • Subject: List Problem (I think) Disguised as a GraphicConverter Problem
  • From: "Jonathan Levi, M.D." <email@hidden>
  • Date: Tue, 8 Mar 2005 20:10:23 -0500

Trying to enhance the limited scriptability of GraphicConverter (GC), I've come upon something I don't understand, seemingly about lists, less likely about GC itself. The problem occurs in the context of a handler I've written to bring a given GC window to the front (requiring Finder; GC seemingly can't do this by itself.)

I have two open GC windows, "a.pict (RGB)" and "b.pict (RGB)", a list gcWindowNames consisting of these two window names, and two ways to get them sequentially, "repeat with i from 1 to (count items of gcWindowNames)" and "repeat with wname in items of gcWindowNames". The first way works, the second doesn't. Is there a fundamental property about iterating through a list's items that I'm missing? --Many thanks, Jonathan

--------------------------------
the Script:

(*
  gcActivateWindow.scpt -- drives a subroutine gcActivateWindow()
  to make GraphicConverter activate a given window. JL 3/8/2005.
*)

on gcActivateWindow(wname)
  tell application "GraphicConverter" to set f to file of window wname
  tell application "Finder" to open f --needed to bring window to front
end gcActivateWindow


set gcWindowNames to {"a.pict (RGB)", "b.pict (RGB)"}

gcActivateWindow("a.pict (RGB)") --works

repeat with i from 1 to (count items of gcWindowNames) --works
  gcActivateWindow(item i of gcWindowNames)
end repeat

repeat with wname in items of gcWindowNames --doesn't work
  gcActivateWindow(wname)
end repeat

--------------------------------
the Event Log:

tell application "GraphicConverter"
  get file of window "a.pict (RGB)"
    file "HD:Users:jonathan:Desktop:a.pict"
end tell
tell application "Finder"
  open file "HD:Users:jonathan:Desktop:a.pict"
end tell
tell application "GraphicConverter"
  get file of window "b.pict (RGB)"
    file "HD:Users:jonathan:Desktop:b.pict"
end tell
tell application "Finder"
  open file "HD:Users:jonathan:Desktop:b.pict"
end tell
tell application "GraphicConverter"
  get file of window "a.pict (RGB)"
    "GraphicConverter got an error: Can't make some data into ¬
      the expected type."
_______________________________________________
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: List Problem (I think) Disguised as a GraphicConverter Problem
      • From: Gil Dawson <email@hidden>
    • Re: List Problem (I think) Disguised as a GraphicConverter Problem
      • From: "Michelle Steiner" <email@hidden>
    • Re: List Problem (I think) Disguised as a GraphicConverter Problem
      • From: Neil Faiman <email@hidden>
  • Prev by Date: Re: Hiding ScriptingAdditions.osax
  • Next by Date: Re: Stop Log
  • Previous by thread: Re: Hiding ScriptingAdditions.osax
  • Next by thread: Re: List Problem (I think) Disguised as a GraphicConverter Problem
  • Index(es):
    • Date
    • Thread