Behövs inte nå mer hittade lösningen
Tack iaf
Där har ni andra som åker fast som mig.
-- Variable listan
set timestamp to (do shell script "date '+%Y%m%d'") -- Datum string
set E_URL to "http://www.metro.se/content/cartoons/elvis/" -- URL Länk
set E_DATE to timestamp -- Datum Variable
set E_PIC to E_URL & E_DATE & ".gif" as string -- URL Variable
set E_DL to "Elvis_" & E_DATE & ".gif" as string -- Bildens namn vid nerladdning
set the E_PLACE to ((path to desktop as string) & E_DL as string) -- Lägger bild på skrivbord
set E_FOLDER to ("Elvis_Pic" as string)
-- Slut på Variabler
-- Första Dialog rutan som frågar om du vill skapa mappen Elvis_Pic
display dialog "Skapa Elvis mappen? Ett måste för att detta ska funka!" buttons {"Japp", "Nepp Har en redan"} default button 2
if the button returned of the result is "Japp" then
-- action for 1st button goes here
tell application "Finder"
if (folder "Elvis_Pic" of desktop exists) is not true then set the E_FOLDER to make new folder at desktop with properties {name:"Elvis_Pic"}
end tell
else
-- action for 2nd button goes here
beep
end if
-- Slut på Första Dialog rutan.
-- Andra Dialog rutan som frågar om du vill ladda hem dagens elvis bild.
display dialog "Hämta dagens Elvis serie? Den laddas ner till ditt skrivbord." buttons {"Nej", "Såklart"} default button 2
if the button returned of the result is "Såklart" then
-- Såklart knappen börjar.
tell application "URL Access Scripting"
download E_PIC to file E_PLACE replacing yes
end tell
tell application "Finder"
move file E_DL of desktop to folder "Elvis_Pic" of desktop
end tell
-- Såklart slutar.
else
-- Nej knappen börjar.
display dialog "Happ skyll dig själv då!" buttons {"Muaha!!!"} default button 1
-- Nej slutar
end if
-- Slut på Andra Dialog rutan.