Vorheriges Thema anzeigen :: Nächstes Thema anzeigen |
Autor |
Nachricht |
Tokoloshe •->


Anmeldedatum: 16.12.2000 Beiträge: 2
|
Verfasst am: 24.05.2001 - 17:32 Titel: Nochmal Netscape getUrl |
|
|
Hallo !
Dank Snows Antwort auf meine erste Anfrage habe ich
- einiges mehr von Apple Script verstanden
- weiter Schritte gemacht
Ab 2000 hat sich die Archiv Struktur der Madam and Eve Homepage geaendert.
Die Files heissen jetzt:
http://www.mg.co.za/madameve/2001/mar/mar12.gif
Also habe ich mich da ran gemacht ein Skript zu schreiben dass mir mit Netscape (das Tool das Snow benutzt hat habe ich nicht) komplett 2000 und 2001 initial runterzieht.
Aber ich bin wohl noch zu dumm.
Das Problem liegt beim Anlegen des Ordners im Finder, bzw, Belegung von derOrdner.
Vielleicht hat ja jemand einen Tip fuer mich:
Das Skript haenge ich unten dran.
Danke fuer alle Tips,
ciao Thomas
set dayList to {"01", "02", "03", "04", "05", "06", "07", "08", ¨
"09", "10", "11", "12", "13", "14", "15", "16", "17", "18", ¨
"19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31"}
set monthList to {"jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"}
set yearList to {"2000", "2001"}
repeat with theYear in yearList
repeat with theMonth in monthList
repeat with theDay in dayList
set the item_name to theMonth & theDay & ".gif"
set the parent_directory to "http://www.mg.co.za/madameve/" & theMonth & "/"
set this_URL to (the parent_directory & the item_name)
set the local_filepath to ((path to desktop folder as text) & "madameve:")
copy local_filepath to folder_path
set local_filepath to local_filepath & theYear & ":" & theMonth
set derOrdner to theYear & ":" & theMonth
tell application "Finder"
if (not (exists folder derOrdner of folder folder_path)) then
set the new_folder to make new folder at folder folder_path ¨
with properties {name:derOrdner}
end if
end tell
tell me to activate
set the timeout_amount to 1800
try
with timeout of timeout_amount seconds
tell application "Netscape Communicatorô"
GetURL this_URL to local_filepath
end tell
end timeout
on error number error_number
if the error_number is -128 then
exit repeat
end if
end try
tell application "Netscape Communicatorô" to quit
end repeat
end repeat
end repeat |
|
Nach oben |
|
 |
Jens Hoffmann •--->

Anmeldedatum: 07.05.2001 Beiträge: 175
|
Verfasst am: 06.06.2001 - 13:14 Titel: Nochmal Netscape getUrl |
|
|
Hi Thomas
Hier der Part, um die Ordnerstruktur anzulegen. Da nicht alle Monate 31 Tage haben, habe ich weiter unten noch eine Version mit den entsprechenden Monatstagen angehängt (Anzahl der Tage lieber nochmal nachprüfen). Die Lösung mit dem Zähler ist wahrscheinlich nicht ganz so elegant. Wie kann man auf den Index eines items aus einer repeat-Schleife zugreifen?
Gruß Jens
------------------
set dayList to {"01", "02", "03", "04", "05", "06", "07", "08", ¨
"09", "10", "11", "12", "13", "14", "15", "16", "17", "18", ¨
"19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31"}
set monthList to {"jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"}
set yearList to {"2000", "2001"}
set pfad to ((path to desktop folder as text) & "madameve:")
tell application "Finder"
repeat with theYear in yearList
set jahre to make new folder at folder pfad with properties {name:theYear}
repeat with theMonth in monthList
set monat to make new folder at jahre with properties {name:theMonth}
repeat with theDay in dayList
set tag to make new folder at monat with properties {name:theDay}
end repeat
end repeat
end repeat
end tell
--------------------------
richtige Anzahl der Tage:
-----------------------
set monthList to {"jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"}
set dayList to {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
set yearList to {"2000", "2001"}
set pfad to ((path to desktop folder as text) & "madameve:")
tell application "Finder"
repeat with i in yearList
set zaehler to 0
set jahr to make new folder at folder pfad with properties {name:i}
repeat with q in monthList
set monat to make new folder at jahr with properties {name:q}
set zaehler to zaehler + 1
repeat with w from 1 to (item zaehler of dayList)
set tag to make new folder at monat with properties {name:w}
end repeat
end repeat
end repeat
end tell |
|
Nach oben |
|
 |
Folker •---->


Anmeldedatum: 11.12.2000 Beiträge: 649 Wohnort: Holsteinische Schweiz
|
Verfasst am: 07.06.2001 - 09:37 Titel: Nochmal Netscape getUrl |
|
|
Hallo,
habe die Postings nur kurz überflogen (die Zeit ). Dabei fiel mir auf: ist es keine Lösung eine Validierung des Datums durchzuführen? Ihr lauft ja sonst in die Schaltjahr-Falle! Also in dem innersten repeat-Loop ein Datum bauen und über date prüfen - falls Fehler 'exit repeat' worauf der nächst höhere repeat-Loop eine Runde weiter startet.
try
set x to "29.2.2001" --hier aus den Variablen das Datum bauen
date x
on error errmsg number num
if num = -30720 then
exit repeat
else
error errmsg number num
end if
end try
Gruß,
Folker _________________ Gruß,
Folker Brandt
=============================
Systemberatung · Datenbanken · Webdesign |
|
Nach oben |
|
 |
|
|
Du kannst keine Beiträge in dieses Forum schreiben. Du kannst auf Beiträge in diesem Forum nicht antworten. Du kannst deine Beiträge in diesem Forum nicht bearbeiten. Du kannst deine Beiträge in diesem Forum nicht löschen. Du kannst an Umfragen in diesem Forum nicht mitmachen.
|
Powered by phpBB © 2001, 2002 phpBB Group Deutsche Übersetzung von phpBB.de
|