Bonjour
Pas trés expert à l'appleScript, je viens vers vous pour un pb surement très simple pour beaucoup d'entre vous.
Quand je lance ce script, je suis bloqué par excel qui me demande si je veux remplacer mon fichier dans cet emplacement.
Je ne veux pas de message, je souhaite que mon script remplace le fichier existant sans me le demander.
Merci d'avance
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50 set file_Name to (path to desktop folder as string) & "CECE:Factures.txt" -- Nom du fichier export set theOutputPath to (path to desktop folder as string) & "CECE:Fiches.txt" -- Nom du fichier modifié pour import display dialog "Cette application va transferer votre Facture en Fiche dans la société POPO" buttons {"Ok"} with icon note tell application "Microsoft Excel" -- Ouvrir excel set silently of window 1 to true set visible to false open text file filename file_Name origin Macintosh data type delimited field info {{1, text format}, {2, text format}, {3, text format}} with tab -- Ourir le fichier export txt* set value of cell ("A" & "1") to "" set value of cell ("B" & "1") to "C" set value of cell ("B" & "4") to "SA" set value of cell ("J" & "4") to "41" set value of cell ("K" & "4") to "" set value of cell ("AS" & "4") to cell ("L" & "4") set value of cell ("L" & "4") to "SARL POPO" set value of cell ("M" & "4") to "" set value of cell ("N" & "4") to "ZZZZZZ" set value of cell ("P" & "4") to "BEEEEEEEEE" set value of cell ("Q" & "4") to "999999" set value of cell ("R" & "4") to "MMMMMM" set value of cell ("U" & "4") to "06 323 323 322" set value of cell ("V" & "4") to "01 43 43 34 43" set value of cell ("W" & "4") to "zzzzzz@orange.fr" set value of cell ("X" & "4") to "FR" set value of cell ("Y" & "4") to "0990909090" set value of cell ("AR" & "4") to "Facture" set value of cell ("AQ" & "4") to "aaaaaaaa" set value of cell ("AU" & "4" & ":" & "BT" & "4") to "" set I to 5 -- Boucle demarant à 5 repeat until (I = 100) -- jusqu'à 100. * if value of cell ("B" & I) is not equal to "" then set value of cell ("B" & I) to "DIVERS" -- si B? n'est pas vide alors saisir vide (B = Code Produit) if value of cell ("B" & I) is equal to "DIVERS" then set value of cell ("AD" & I) to "XXXX0XXXX1XXXX0XXXX0XXXX1XXXX0.989465XXXX0.069867XXXX0.043890" if value of cell ("D" & I) is not equal to "" then set value of cell ("D" & I) to "" -- D = Px Unit if value of cell ("G" & I) is not equal to "" then set value of cell ("G" & I) to "" -- G = Remise if value of cell ("H" & I) is not equal to "" then set value of cell ("H" & I) to "" -- H = Code TVA if value of cell ("I" & I) is not equal to "" then set value of cell ("I" & I) to "" -- I = Taux TVA if value of cell ("J" & I) is not equal to "" then set value of cell ("J" & I) to "" -- J = Px Achat set I to I + 1 -- augmenter la valeur de I +1 log I -- lit I end repeat -- s'arreter si I = 100 tell active workbook activate save workbook as filename theOutputPath file format current platform text file format with «class 5321» and overwrite without asking -- Sauvegarder modifs dans nouveau fichier delay 0.5 quit saving no -- fermer les fichiers excel end tell end tell ....
Partager