• 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: refer to current picture
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: refer to current picture


  • Subject: Re: refer to current picture
  • From: "koenig.yvan" <email@hidden>
  • Date: Sun, 05 Aug 2012 18:42:16 +0200


Le 05/08/2012 à 18:12, Robert Poland <email@hidden> a écrit :

Hi,

I have a script,
on open (droppedItem)
…

that I use to drop a picture on to be rescaled.

I would like to use a shortcut key (iKey) to run that script when the picture is open (in GraphicConverter).

I am assuming that something like this would do,

on run
set droppedItem to name of window 1
main()
end run

I am at a loss on how to refer to the currently open picture, help please.

TIA,


In the open handler, droppedItem is a list of alias.
In your run handler, droppedItem is the name of a window which may be the name of the displayed file, not its pathname.

Try something like that :


on run
(*
tell application "GraphicConverter"
set droppedItem to path of window 1
end tell
*)
my main(droppedItem)
end run

on open (droppedItem)
(*
Here droppedItem is a list of alias
*)
my main(droppedItem's item 1)
end open

on main(anItem)
(*
do your duty upon anItem 
*)
end main

I don't own GraphicConverter so I left the code as comments.
Check the syntax giving you the pathname of the file displayed in the window 1.

Yvan KOENIG (VALLAURIS, France) dimanche 5 août 2012 18:39:56



 _______________________________________________
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: refer to current picture
      • From: Robert Poland <email@hidden>
    • Re: refer to current picture
      • From: Luther Fuller <email@hidden>
References: 
 >refer to current picture (From: Robert Poland <email@hidden>)

  • Prev by Date: refer to current picture
  • Next by Date: Re: refer to current picture
  • Previous by thread: refer to current picture
  • Next by thread: Re: refer to current picture
  • Index(es):
    • Date
    • Thread