Re: refer to current picture
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