Applescript ridimensiona immagine
Moderatore: Moderatori
- jelux
- Messaggi: 30
- Iscritto il: giovedì 14 luglio 2016, 9:44
- Versione FileMaker: 18
- Sistema operativo: 10.14.6
- Contatta:
Applescript ridimensiona immagine
Ciao a tutto un piccolo aiuto per uno script applescript e filemaker. Sto costruendo questo script :
imposta variabile [ $$CoverNome; Valore: W001_LAVORI::Codice lavoro ]
imposta variabile [ $$SelectImage; Valore: BE_SelectFile ( "Inserire cover lavoro" ; Get ( PercorsoDesktop ) ) ]
imposta variabile [ $$theImageFile; Valore: "Volumes" & CercaeSost ( $$SelectImage ; "/" ; ":" ) ]
Esegui applescript [
" set theImageFile to " & "\”" & $$theImageFile & "\” of type \” public.image \" with prompt \"\" ¶¶
set theOutputFolder to (path to desktop folder as string) ¶¶
set scaleByPercentage to true ¶¶
tell application \” Image Events \”¶¶
launch ¶¶
set theImage to open theImageFile ¶
tell theImage¶¶
set theName to name ¶
set theSaveName to " & "\”" & $$CoverNome & "\” & theName ¶¶
if scaleByPercentage = true then ¶
scale by factor 0.5 ¶¶
else ¶¶
scale to size 100 ¶¶
end if ¶
save as JPEG in (theOutputFolder & theSaveName ) ¶¶
close ¶
end tell ¶
end tell¶
"
]
per ridimensionare una immagine usato due variabili $$theImageFile per definire il file da convertire e uso BE_SelectFile
ma mi da sempre errore a livello di applescript credo, mi dice:
Un prompt:true non può andare dopo questo Volumes:Users:WorkStationJelux:Desktop:B&V Divani.png.
e poi
Errore sconosciuto: -2740.
secondo voi dive sbaglio?
Grazie mille
in allegato lo script di applescript
imposta variabile [ $$CoverNome; Valore: W001_LAVORI::Codice lavoro ]
imposta variabile [ $$SelectImage; Valore: BE_SelectFile ( "Inserire cover lavoro" ; Get ( PercorsoDesktop ) ) ]
imposta variabile [ $$theImageFile; Valore: "Volumes" & CercaeSost ( $$SelectImage ; "/" ; ":" ) ]
Esegui applescript [
" set theImageFile to " & "\”" & $$theImageFile & "\” of type \” public.image \" with prompt \"\" ¶¶
set theOutputFolder to (path to desktop folder as string) ¶¶
set scaleByPercentage to true ¶¶
tell application \” Image Events \”¶¶
launch ¶¶
set theImage to open theImageFile ¶
tell theImage¶¶
set theName to name ¶
set theSaveName to " & "\”" & $$CoverNome & "\” & theName ¶¶
if scaleByPercentage = true then ¶
scale by factor 0.5 ¶¶
else ¶¶
scale to size 100 ¶¶
end if ¶
save as JPEG in (theOutputFolder & theSaveName ) ¶¶
close ¶
end tell ¶
end tell¶
"
]
per ridimensionare una immagine usato due variabili $$theImageFile per definire il file da convertire e uso BE_SelectFile
ma mi da sempre errore a livello di applescript credo, mi dice:
Un prompt:true non può andare dopo questo Volumes:Users:WorkStationJelux:Desktop:B&V Divani.png.
e poi
Errore sconosciuto: -2740.
secondo voi dive sbaglio?
Grazie mille
in allegato lo script di applescript
Non hai i permessi necessari per visualizzare i file allegati in questo messaggio.
Jelux s.r.l. DigitalWorks
and DoubleArt
Via XXV Aprile 116 - 25020 Flero (Brescia) Italy
Fax: +39 030 3581399
web: www.jelux.it
info mail: info@jelux.it
and DoubleArt
Via XXV Aprile 116 - 25020 Flero (Brescia) Italy
Fax: +39 030 3581399
web: www.jelux.it
info mail: info@jelux.it
- fabio.beri
- Messaggi: 1967
- Iscritto il: sabato 4 ottobre 2014, 16:24
- Versione FileMaker: 2023
- Sistema operativo: Win/Mac
Re: Applescript ridimensiona immagine
Nel percorso c'è una E commerciale ? Eviterei.
Comunque un consiglio è di testare lo script (di Applescript) fuori da FileMaker, eseguendolo come stand-alone, così da poter rilevare l'errore.
Comunque un consiglio è di testare lo script (di Applescript) fuori da FileMaker, eseguendolo come stand-alone, così da poter rilevare l'errore.
Fabio Beri
Moderatore FMPro.it
Sviluppatore OmniaGest 5 - FileMaker 15/16/17/18/19
Omnia Studio
-----------------------------------------
http://tinyurl.com/omniagest2024
Moderatore FMPro.it
Sviluppatore OmniaGest 5 - FileMaker 15/16/17/18/19
Omnia Studio
-----------------------------------------
http://tinyurl.com/omniagest2024
- jelux
- Messaggi: 30
- Iscritto il: giovedì 14 luglio 2016, 9:44
- Versione FileMaker: 18
- Sistema operativo: 10.14.6
- Contatta:
Re: Applescript ridimensiona immagine
Ciao scusa se rispondo in ritardo.
Cosa intendi per Nel percorso c'è una E commerciale ? Eviterei.
intendi la riga = set theSaveName to " & "\”" & $$CoverNome & "\” & theName ¶¶ ?
La & fa parte dello script originale che usato con applescript o anche automator funziona bene , io ho solo sostituito questa siringa
-- Prompt for an image
set theImageFile to choose file of type "public.image" with prompt ""
con una variabile
imposta variabile [ $$SelectImage; Valore: BE_SelectFile ( "Inserire cover lavoro" ; Get ( PercorsoDesktop ) ) ]
lo script di base è il seguente,
grazie mille
Cosa intendi per Nel percorso c'è una E commerciale ? Eviterei.
intendi la riga = set theSaveName to " & "\”" & $$CoverNome & "\” & theName ¶¶ ?
La & fa parte dello script originale che usato con applescript o anche automator funziona bene , io ho solo sostituito questa siringa
-- Prompt for an image
set theImageFile to choose file of type "public.image" with prompt ""
con una variabile
imposta variabile [ $$SelectImage; Valore: BE_SelectFile ( "Inserire cover lavoro" ; Get ( PercorsoDesktop ) ) ]
lo script di base è il seguente,
Codice: Seleziona tutto
-- Prompt for an image
set theImageFile to choose file of type "public.image" with prompt ""
-- Locate an output folder
set theOutputFolder to (path to desktop folder as string)
-- To scale by percentage, set this value to true. To scale to a specific size, set it to false.
set scaleByPercentage to true
-- Launch Image Events
tell application "Image Events"
launch
-- Open the image
set theImage to open theImageFile
tell theImage
-- Determine a save name for the image
set theName to name
set theSaveName to "cover-" & theName
-- Scale the image by 50%
if scaleByPercentage = true then
scale by factor 0.5
-- Scale the image to 100px on its longese side
else
scale to size 100
end if
-- Save the image as a .jpg
save as JPEG in (theOutputFolder & theSaveName)
-- Close the image
close
end tell
end tell
grazie mille
Jelux s.r.l. DigitalWorks
and DoubleArt
Via XXV Aprile 116 - 25020 Flero (Brescia) Italy
Fax: +39 030 3581399
web: www.jelux.it
info mail: info@jelux.it
and DoubleArt
Via XXV Aprile 116 - 25020 Flero (Brescia) Italy
Fax: +39 030 3581399
web: www.jelux.it
info mail: info@jelux.it