Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

[Q] Applescript et GraphicConverter

2 réponses
Avatar
blanc
Bonjour à tous,

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

2 réponses

Avatar
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
Avatar
blanc
Patrick Stadelmann wrote:

tell application "Finder"
[...snip]
end tell



Génial !...

Merci Patrick :-)

--
JiPaul.
/ /--/--// Jean-Paul Blanc
|/| L | quelquepart en (somewhere in)
/|| = ||| FRANCE