Sujet: script conditionnel sur ps CS3

Modérateur: Modérateurs

Poster une réponse

script conditionnel sur ps CS3

par cyberlecgui » Dimanche 28 Décembre 2008 13:16

Bonjour,

Voilà mon problème, j'ai une photo en 75x50cm en paysage. Actuellement j'ai 2 scripts qui bascule la photo en 800x600 ou 600x800 selon l'orientation.

Je voudrais faire un script qui examine le sens de ma photo et en fonction de son orientation me lance la réduction soit en portrait soit en paysage.

De cette manière, je n'aurais plus qu'un seul script a lancer sur un traitement par lot par exemple.

Auriez-vous une idée SVP ?

Cordialement,
Guillaume

Photos: 366
cyberlecgui

Membre VIP
Membre VIP

Messages: 970

Inscription: 12 Déc 2005

Localisation: Bruxelles

Boitier 1: - Nikon D610

Boitier 2: - Nikon D5300

Objectif 1: - Nikkor 24-120mm f/4G ED AF-S VR

Objectif 2: - Sigma 70-200mm f/2.8 APO EX II DG HSM

Objectif 3: - Nikkor 50mm f/1.4G AF-S

Flash 1: - Nikon SB-900

Galerie personnelle : http://www.guillaumelecomte.com
Publicité

par stephh » Jeudi 29 Janvier 2009 14:00

salut cyberlecgui,

le seul moyen que j'ai trouvé, c'est de faire un VBScript qui pilote CS.
si t'es sous windows et que le code t'intéresse, fais-le-moi savoir :wink:

Photos: 2163
stephh

Membre VIP
Membre VIP

Messages: 37464

Inscription: 26 Nov 2005

Localisation: Morges, CH

Boitier 1: - D300

Boitier 2: - D60

Objectif 1: - Fisheye AF DX 10,5 f/2.8 D

Objectif 2: - Nik 12-24mm f/4G ED-IF AF-S DX

Objectif 3: - Nik 17-55mm f/2.8G ED-IF AF-S DX

Objectif 4: - Nik 35mm f/1.8G AF-S DX

Objectif 5: - Micro Nik 60mm f/2.8 ED AF-S

Objectif 6: - Nik 70-200mm f/2.8G ED-IF AF-S VR

Objectif 7: - Micro Nik 105 f/2.8 D AF

Objectif 8: - Nik 300mm f/2.8D ED-IF II AF-S

Objectif 9: - Nik 18-55mm f/3.5-5.6G ED AF-S DX II

Flash 1: - SB-800

Flash 2: - SB-800

Flash 3: - SU-800

Flash 4: - SB-R200

par cyberlecgui » Jeudi 29 Janvier 2009 18:04

Salut stephh,

Oui justement j'y pensais je suis preneur.

Guillaume

Photos: 366
cyberlecgui

Membre VIP
Membre VIP

Messages: 970

Inscription: 12 Déc 2005

Localisation: Bruxelles

Boitier 1: - Nikon D610

Boitier 2: - Nikon D5300

Objectif 1: - Nikkor 24-120mm f/4G ED AF-S VR

Objectif 2: - Sigma 70-200mm f/2.8 APO EX II DG HSM

Objectif 3: - Nikkor 50mm f/1.4G AF-S

Flash 1: - Nikon SB-900

Galerie personnelle : http://www.guillaumelecomte.com

par stephh » Vendredi 30 Janvier 2009 11:11

alors voici un petit VBScript.
je le lance depuis un dossier.
s'il trouve un fichier .xmp, c'est que le .nef a été post-traité dans CS.
dans ce cas, il ouvre le nef et lance le script approprié en fonction de l'orientation.



Code: Tout sélectionner
Sub CreateWebPhoto(path,nef)
    Dim appRef
    Set appRef = CreateObject("Photoshop.Application")
    Set docRef = appRef.Open(path+nef+".NEF")
    imgHeight = docRef.Height
    imgWidth = docRef.Width
    If imgHeight > imgWidth Then
        appRef.DoAction "Nom_du_script_portrait", "nom_de_l'ensemble"
    Else
        appRef.DoAction "Nom_du_script_paysage", "nom_de_l'ensemble"
    End If
    appRef.ActiveDocument.Close 2
End Sub

Dim stRep
Dim oFSO,oFl, f
Set oFSO = CreateObject("Scripting.FileSystemObject")
stRep = oFSO.GetAbsolutePathName(".") + "\"
If oFSO.FolderExists(stRep) Then
 For each oFl in  oFSO.GetFolder(stRep).Files
     If Right(oFl.Name,4) = ".xmp" Then 
        CreateWebPhoto stRep,Replace(oFl.Name, ".xmp", "")
     End If
 Next
End If
MsgBox "OK"


en espérant que cela puisse t'aider :)
c'est très basique, d'ailleurs à noter que le nom du fichier xmp doit etre en minuscule.

Photos: 2163
stephh

Membre VIP
Membre VIP

Messages: 37464

Inscription: 26 Nov 2005

Localisation: Morges, CH

Boitier 1: - D300

Boitier 2: - D60

Objectif 1: - Fisheye AF DX 10,5 f/2.8 D

Objectif 2: - Nik 12-24mm f/4G ED-IF AF-S DX

Objectif 3: - Nik 17-55mm f/2.8G ED-IF AF-S DX

Objectif 4: - Nik 35mm f/1.8G AF-S DX

Objectif 5: - Micro Nik 60mm f/2.8 ED AF-S

Objectif 6: - Nik 70-200mm f/2.8G ED-IF AF-S VR

Objectif 7: - Micro Nik 105 f/2.8 D AF

Objectif 8: - Nik 300mm f/2.8D ED-IF II AF-S

Objectif 9: - Nik 18-55mm f/3.5-5.6G ED AF-S DX II

Flash 1: - SB-800

Flash 2: - SB-800

Flash 3: - SU-800

Flash 4: - SB-R200

par patrikB » Vendredi 30 Janvier 2009 11:15

Lo :coucou21:

Ca m'interresse aussi mais la, n'étant pas informaticien, j'entrave couic...

Ca marche comment :oops:

:mrgreen:

Photos: 2098
patrikB

Membre VIP
Membre VIP

Messages: 19578

Inscription: 12 Fév 2008

Localisation: 62 Arras ou pas loin

par stephh » Vendredi 30 Janvier 2009 11:19

tu ouvres le bloc-notes
tu colles le code ci-dessus (en le modifiant selon tes scripts bien sûr)
tu l'enregistres dans le dossier que tu veux traiter, avec l'extension .vbs
avec l'explorateur de fichiers tu vas dans le dossier
tu double-clique sur ton nouveau fichier vbs pour le lancer
à la fin du process, tu auras un message "OK", et tu peux fermer CS

Photos: 2163
stephh

Membre VIP
Membre VIP

Messages: 37464

Inscription: 26 Nov 2005

Localisation: Morges, CH

Boitier 1: - D300

Boitier 2: - D60

Objectif 1: - Fisheye AF DX 10,5 f/2.8 D

Objectif 2: - Nik 12-24mm f/4G ED-IF AF-S DX

Objectif 3: - Nik 17-55mm f/2.8G ED-IF AF-S DX

Objectif 4: - Nik 35mm f/1.8G AF-S DX

Objectif 5: - Micro Nik 60mm f/2.8 ED AF-S

Objectif 6: - Nik 70-200mm f/2.8G ED-IF AF-S VR

Objectif 7: - Micro Nik 105 f/2.8 D AF

Objectif 8: - Nik 300mm f/2.8D ED-IF II AF-S

Objectif 9: - Nik 18-55mm f/3.5-5.6G ED AF-S DX II

Flash 1: - SB-800

Flash 2: - SB-800

Flash 3: - SU-800

Flash 4: - SB-R200

par patrikB » Vendredi 30 Janvier 2009 11:30

Je vais essayer ca ...
Merci :tp:

Photos: 2098
patrikB

Membre VIP
Membre VIP

Messages: 19578

Inscription: 12 Fév 2008

Localisation: 62 Arras ou pas loin

par stephh » Vendredi 30 Janvier 2009 11:32

avec plaisir.
à noter que si le but est de sortir des photos au format web, c'est ton script CS qui doit les enregistrer :wink:

Photos: 2163
stephh

Membre VIP
Membre VIP

Messages: 37464

Inscription: 26 Nov 2005

Localisation: Morges, CH

Boitier 1: - D300

Boitier 2: - D60

Objectif 1: - Fisheye AF DX 10,5 f/2.8 D

Objectif 2: - Nik 12-24mm f/4G ED-IF AF-S DX

Objectif 3: - Nik 17-55mm f/2.8G ED-IF AF-S DX

Objectif 4: - Nik 35mm f/1.8G AF-S DX

Objectif 5: - Micro Nik 60mm f/2.8 ED AF-S

Objectif 6: - Nik 70-200mm f/2.8G ED-IF AF-S VR

Objectif 7: - Micro Nik 105 f/2.8 D AF

Objectif 8: - Nik 300mm f/2.8D ED-IF II AF-S

Objectif 9: - Nik 18-55mm f/3.5-5.6G ED AF-S DX II

Flash 1: - SB-800

Flash 2: - SB-800

Flash 3: - SU-800

Flash 4: - SB-R200

par patrikB » Vendredi 30 Janvier 2009 11:50

Pour le script enregistrer c'est ok en script ;)

Photos: 2098
patrikB

Membre VIP
Membre VIP

Messages: 19578

Inscription: 12 Fév 2008

Localisation: 62 Arras ou pas loin

par patrikB » Vendredi 30 Janvier 2009 12:09

stephh, cela s'apparente t'il a ce script que j'ai débarrassé des mes personnalisations pour test
Script dont j'ai trouvé la base sur le web et dont j'ai oublié l'auteur mais que je remercie.

Redimensionne les images dans les 2 sens et renforce la netteté pour la mise sur forum

Test script

Photos: 2098
patrikB

Membre VIP
Membre VIP

Messages: 19578

Inscription: 12 Fév 2008

Localisation: 62 Arras ou pas loin

par cyberlecgui » Vendredi 30 Janvier 2009 16:13

Salut Stephh,

Je vais regarder cela chez moi tranquillement ce soir.
Je vais voir pour le faire en JPEG.

A+

Guillaume

Photos: 366
cyberlecgui

Membre VIP
Membre VIP

Messages: 970

Inscription: 12 Déc 2005

Localisation: Bruxelles

Boitier 1: - Nikon D610

Boitier 2: - Nikon D5300

Objectif 1: - Nikkor 24-120mm f/4G ED AF-S VR

Objectif 2: - Sigma 70-200mm f/2.8 APO EX II DG HSM

Objectif 3: - Nikkor 50mm f/1.4G AF-S

Flash 1: - Nikon SB-900

Galerie personnelle : http://www.guillaumelecomte.com

par cyberlecgui » Dimanche 01 Février 2009 15:02

J'ai testé mais hélas ça ne fonctionne pas.

Le script se lance bien mais tout le suite j'ai le message OK aucun traitement ne se produit sur PS.

Aurais-tu une idée stp ?

Photos: 366
cyberlecgui

Membre VIP
Membre VIP

Messages: 970

Inscription: 12 Déc 2005

Localisation: Bruxelles

Boitier 1: - Nikon D610

Boitier 2: - Nikon D5300

Objectif 1: - Nikkor 24-120mm f/4G ED AF-S VR

Objectif 2: - Sigma 70-200mm f/2.8 APO EX II DG HSM

Objectif 3: - Nikkor 50mm f/1.4G AF-S

Flash 1: - Nikon SB-900

Galerie personnelle : http://www.guillaumelecomte.com

par stephh » Lundi 02 Février 2009 10:28

salut cyberlecgui,

t'as bien remplacé les 2 lignes :

appRef.DoAction "Nom_du_script_portrait", "nom_de_l'ensemble"
et
appRef.DoAction "Nom_du_script_paysage", "nom_de_l'ensemble"

par le nom de tes scripts et ensembles ?

Photos: 2163
stephh

Membre VIP
Membre VIP

Messages: 37464

Inscription: 26 Nov 2005

Localisation: Morges, CH

Boitier 1: - D300

Boitier 2: - D60

Objectif 1: - Fisheye AF DX 10,5 f/2.8 D

Objectif 2: - Nik 12-24mm f/4G ED-IF AF-S DX

Objectif 3: - Nik 17-55mm f/2.8G ED-IF AF-S DX

Objectif 4: - Nik 35mm f/1.8G AF-S DX

Objectif 5: - Micro Nik 60mm f/2.8 ED AF-S

Objectif 6: - Nik 70-200mm f/2.8G ED-IF AF-S VR

Objectif 7: - Micro Nik 105 f/2.8 D AF

Objectif 8: - Nik 300mm f/2.8D ED-IF II AF-S

Objectif 9: - Nik 18-55mm f/3.5-5.6G ED AF-S DX II

Flash 1: - SB-800

Flash 2: - SB-800

Flash 3: - SU-800

Flash 4: - SB-R200

par cyberlecgui » Lundi 02 Février 2009 15:52

Oui j'ai bien mis les noms

Photos: 366
cyberlecgui

Membre VIP
Membre VIP

Messages: 970

Inscription: 12 Déc 2005

Localisation: Bruxelles

Boitier 1: - Nikon D610

Boitier 2: - Nikon D5300

Objectif 1: - Nikkor 24-120mm f/4G ED AF-S VR

Objectif 2: - Sigma 70-200mm f/2.8 APO EX II DG HSM

Objectif 3: - Nikkor 50mm f/1.4G AF-S

Flash 1: - Nikon SB-900

Galerie personnelle : http://www.guillaumelecomte.com

par stephh » Lundi 02 Février 2009 15:53

t'as bien des fichiers xmp ?

Photos: 2163
stephh

Membre VIP
Membre VIP

Messages: 37464

Inscription: 26 Nov 2005

Localisation: Morges, CH

Boitier 1: - D300

Boitier 2: - D60

Objectif 1: - Fisheye AF DX 10,5 f/2.8 D

Objectif 2: - Nik 12-24mm f/4G ED-IF AF-S DX

Objectif 3: - Nik 17-55mm f/2.8G ED-IF AF-S DX

Objectif 4: - Nik 35mm f/1.8G AF-S DX

Objectif 5: - Micro Nik 60mm f/2.8 ED AF-S

Objectif 6: - Nik 70-200mm f/2.8G ED-IF AF-S VR

Objectif 7: - Micro Nik 105 f/2.8 D AF

Objectif 8: - Nik 300mm f/2.8D ED-IF II AF-S

Objectif 9: - Nik 18-55mm f/3.5-5.6G ED AF-S DX II

Flash 1: - SB-800

Flash 2: - SB-800

Flash 3: - SU-800

Flash 4: - SB-R200

Poster une réponse
Suivante

Poster une réponse

Citer la selection
 

Qui est en ligne

Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 1 invité