Je voudrais faire un script qui ouvre un dossier dans le gestionnaire
d'images de GC d'après la sélection dans le Finder :
- si c'est un fichier, ouvre le dossier qui contient ce fichier
- sinon ouvre le dossier lui-même
Voici ce que j'ai écrit (plus bas), mais ça ne marche vraiment pas.
Comme d'habitude j'ai tatonné autour de ça et consulté les dicos AS,
mais je n'y arrive pas...
Pas très doué en fait dans la syntaxe d'AS que je trouve très peu
intuitive :-(
Un peu d'aide svp ?...
on run
if (application "Finder" is frontmost) then
tell application "Finder"
set fichhh to selection
if fichhh is a file
then set doss to folder of fichhh
else set doss to fichhh
end tell
try
tell application "GraphicConverter"
activate
browser doss
end tell
end try
end if
end run
--
JiPaul.
/ /--/--//\\ Jean-Paul Blanc
|/| L |\\\ quelquepart en (somewhere in)
\/|| = |||\\\ FRANCE
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
Patrick Stadelmann
In article <1j1qi1w.161xzz41dh4vtmN%, (JiPaul) wrote:
Je voudrais faire un script qui ouvre un dossier dans le gestionnaire d'images de GC d'après la sélection dans le Finder : - si c'est un fichier, ouvre le dossier qui contient ce fichier - sinon ouvre le dossier lui-même
tell application "Finder" try set s to selection -- force la résolution de "selection" set f to item 1 of s as alias -- "selection" est une liste end try set isFolder to false try -- si f est un dossier, disque, ... "container window" existe container window of f set isFolder to true end try if isFolder = false then set f to container of f as alias end if end tell
tell application "GraphicConverter" try browser f end try end tell
Patrick -- Patrick Stadelmann
In article <1j1qi1w.161xzz41dh4vtmN%blanc@empty.org>,
blanc@empty.org (JiPaul) wrote:
Je voudrais faire un script qui ouvre un dossier dans le gestionnaire
d'images de GC d'après la sélection dans le Finder :
- si c'est un fichier, ouvre le dossier qui contient ce fichier
- sinon ouvre le dossier lui-même
tell application "Finder"
try
set s to selection -- force la résolution de "selection"
set f to item 1 of s as alias -- "selection" est une liste
end try
set isFolder to false
try
-- si f est un dossier, disque, ... "container window" existe
container window of f
set isFolder to true
end try
if isFolder = false then
set f to container of f as alias
end if
end tell
tell application "GraphicConverter"
try
browser f
end try
end tell
Patrick
--
Patrick Stadelmann <Patrick.Stadelmann@unine.ch>
In article <1j1qi1w.161xzz41dh4vtmN%, (JiPaul) wrote:
Je voudrais faire un script qui ouvre un dossier dans le gestionnaire d'images de GC d'après la sélection dans le Finder : - si c'est un fichier, ouvre le dossier qui contient ce fichier - sinon ouvre le dossier lui-même
tell application "Finder" try set s to selection -- force la résolution de "selection" set f to item 1 of s as alias -- "selection" est une liste end try set isFolder to false try -- si f est un dossier, disque, ... "container window" existe container window of f set isFolder to true end try if isFolder = false then set f to container of f as alias end if end tell
tell application "GraphicConverter" try browser f end try end tell
Patrick -- Patrick Stadelmann
blanc
Patrick Stadelmann wrote:
tell application "Finder" [...snip] end tell
Génial !...
Merci Patrick :-)
-- JiPaul. / /--/--// Jean-Paul Blanc |/| L | quelquepart en (somewhere in) /|| = ||| FRANCE
Patrick Stadelmann <Patrick.Stadelmann@unine.ch> wrote:
tell application "Finder"
[...snip]
end tell
Génial !...
Merci Patrick :-)
--
JiPaul.
/ /--/--//\ Jean-Paul Blanc
|/| L |\ quelquepart en (somewhere in)
/|| = |||\ FRANCE