Fischer-Bayern.de
 FAQFAQ   SuchenSuchen   MitgliederlisteMitgliederliste   BenutzergruppenBenutzergruppen   RegistrierenRegistrieren 
 ProfilProfil   Einloggen, um private Nachrichten zu lesenEinloggen, um private Nachrichten zu lesen   LoginLogin 

Befehlsverzeichnis von Now-up-to-date: AS-scripten wie?

 
Dieses Forum ist gesperrt, du kannst keine Beiträge editieren, schreiben oder beantworten.   Dieses Thema ist gesperrt, du kannst keine Beiträge editieren oder beantworten.    Fischer-Bayern.de Foren-Übersicht -> AppleScript-Forum
Vorheriges Thema anzeigen :: Nächstes Thema anzeigen  
Autor Nachricht
spirigwi
•----->
•----->


Anmeldedatum: 10.07.2003
Beiträge: 1517
Wohnort: Olten-CH

BeitragVerfasst am: 06.09.2005 - 22:41    Titel: Befehlsverzeichnis von Now-up-to-date: AS-scripten wie? Antworten mit Zitat

Da ich mir schon etwas sicherheit mit Datums-Formationen verschafft habe wage ich den Versuch aus der typetext- oder keystroke- Technik auszubrechen, da ich die oft anwende wenn ich aus dem Befehlsverzeichnis eines Programms hinten noch vorne weiss was zu tun iist:

Kann mir jemand helfen wie man ZB ein neues appointment macht wenn ich ihm den entspr. Teil des Befehlsverzeichnisses vorlese?
Aus Now-up-do-dates Befehlverzeichnis hat Folgendes geschrieben:

Class event : An event, such as a holiday, appointment or to-do
Properties:
uniqueid event id [r/o] -- the unique ID of the event
name text -- the title of the event
description text -- the description of the event
owner text [r/o] -- the person who last modified the event
priority constant -- the priority of the event. Set it by using a priority name. Get custom priority names for a category from the prioritynames property of the category.
remindermethod remindmenubar/reminddialog/remindnone -- the kind of reminder to issue. Setting it to remindnone automatically sets remindbefore to 0.
remindbefore integer -- the number of seconds before the event. Applicable only to holiday, special, appointment, to-do and call events. Seconds should be equivalent to a whole number of days for holiday and special events, and for to-do and call events having no start time.
eventtype holiday/special/appointment/to-do/call/undated/stickynote/banner/graphic -- the kind of event
carry forward boolean -- whether a to-do or call event carries forward
startdate date -- the date the event starts (always at 12:00 AM). Set it, and get it using the filter reference form as a property of a document, using a date value, text such as "May 14", or a relative date such as "tomorrow"
starttime integer -- the time the event starts. Get and set it as the number of seconds since midnight, or set it using text such as "11:45 AM".
endtime integer -- the time the event ends. Get and set it as the number of seconds since midnight, or set it using text such as "11:45 AM".
startdatetime date -- the date and time the event starts. Set either this or the startdate and starttime, not both; the others are set automatically.
duration integer -- the duration of the event in seconds. Set either this or the endtime, not both; the other is set automatically.
completed boolean -- true if a to-do, call or undated event is done, false if not
Elements:
person by numeric index, event id
timeblock by numeric index


Fehlt noch etwas irgend eine weitere Info?
ein erster Versuch ergibt:
tell application "Now Up-to-Date"
set a to name of window 1 -- soweit gehts
make new appointment with startdate --hier Fehlermeldung:
--"some parameter is missing for make"
end tell

_________________
 Skript-Fan => ein � -Fan =>Scr¿¿-KongFuSius_Kurpfusius
Nach oben
Benutzer-Profile anzeigen Private Nachricht senden AIM-Name
spirigwi
•----->
•----->


Anmeldedatum: 10.07.2003
Beiträge: 1517
Wohnort: Olten-CH

BeitragVerfasst am: 11.09.2005 - 08:23    Titel: Antworten mit Zitat

ein bisschen hab ich durchexperimentiert und die appleAkript-Läufigkeit zumindest beweisen können:

tell application "Now Up-to-Date"
set bounds of window 1 to {0, -10, 405, 469} --funktioniert super
set a to name of every event of document 1

(*
funktioniert super ergibt aber was ganz komisches:
es listet einfach alle definierten Categorien auf, ZB
geb ich 3 mögliche Categorien ein für ein appointment:
die erste hat Name : "1.Categorie"...usw
also nach
name of every event of document 1 gibts:
*)
{"1.Categorie", "2.Categorie", "3.Categorie usw"}
get selection
--get selection --> liest folgendes: timeblock 1 of event id «data ID 080000040F000000BF4925D70001FFFF» of category id «data ID 080000040F000000BF4925D70001FFFF» of document "Patient Kalender mcchef" of application "Now Up-to-Date"

--make new appointment of document "Patient Kalender mcchef" of application "Now Up-to-Date"--Fehler: not alowed

end tell
a


Dies da hat den hacken dass es wieder "missing some.." meldet
tell application "Now Up-to-Date"
make new event with properties ¬
{uniqueid:¬
"1", name:¬
"name", description:¬
"descr", owner:¬
"", priority:¬
"none", remindermethod:¬
"bing", remindbefore:¬
"never", eventtype:¬
"appt.", carry forward:¬
"1", startdate:¬
"10.9.2005", starttime:¬
"10:30:00", endtime:¬
"11:30:00", startdatetime:¬
"", duration:¬
"01:00", completed:¬
"done"}
end tell

Nun hat jemand einen tipp wie man da etwas systematischer vorankommt um für eine neues appointment den timeblock oder event oder was auch nehmen muss und wie man diese AS-Anweisungen mit propertys und CLASS in eine AS-Zeile umformulieren kann?

Gibts eine Systematik dazu die erlernbar ist?

Soll man besser now-up-to-date um AS-Beispiele fragen?

Was macht ihr in solchen Fällen?(wo man also ein ausführliches Befehlsverzeichnis zur Verfügung hat jedoch nicht ein einziges Beispiel dazu)
_________________
 Skript-Fan => ein � -Fan =>Scr¿¿-KongFuSius_Kurpfusius
Nach oben
Benutzer-Profile anzeigen Private Nachricht senden AIM-Name
spirigwi
•----->
•----->


Anmeldedatum: 10.07.2003
Beiträge: 1517
Wohnort: Olten-CH

BeitragVerfasst am: 11.09.2005 - 15:36    Titel: Antworten mit Zitat

na endlich, man muss sich halt zu helfen wissen:
man kann also now-up-5 herunterholen, gratis, sie als try für 30 Tage rattern lassen und erhält dann ein Geschenk dazu, nämlich AppleSkript-Zeilen in Hülle und Fülle, die man dann halt nur auf dem OSX-Rechner entdownloaden kann aber immerhin für OS9 ZB folgende hochwertigen Skriptbeispiel-Zeilen erangeln kann:

YOU_CANNOT_RUN_THIS_SCRIPT()

on Read_This_Information()
   tell application "Now Up-To-Date"
      
      -- The Now Up-to-Date timeblock class supports the startdate, starttime, endtime, startdatetime,
      -- duration, completed and eventdata properties. A timeblock object contains no elements.
      
      -- A timeblock object is an element contained in an event object. See the Event Object example
      -- script for information about how to refer to a timeblock as an element of an event object using
      -- the index reference form. As described in the Event Object example script, the properties of the
      -- first timeblock of an event (except for the eventdata property) can be accessed directly as
      -- implicit properties of the event, but it is usually prudent to refer to them through timeblock 1
      -- explicitly.
      
      -- Each timeblock object refers to one instance or repetition of an event, each of which has differing
      -- date and time values. Some of the date and time values may have different interpretations depending
      -- on the type of event.
      
      -- PROPERTIES:
      
      -- A property of a timeblock object can be accessed in a 'tell timeblock' block or by the use of
      -- the 'of timeblock' syntax, and the reference should always specify the event, the calendar and
      -- the document. All of the properties can be set to new values. For example:
      
      tell event 1 of category 1 of document 1
         get startdate of timeblock 1 --> returns an AppleScript date representing the day on which
         -- timeblock 1 starts; the time of this property is always stored as 12:00 AM (first thing in
         -- the morning), no matter what time you try to set it to
         get starttime of timeblock 1 --> returns an integer representing the time of day at which
         -- timeblock 1 starts, as the number of seconds since midnight
         get endtime of timeblock 1 --> returns an integer representing the time of day at which
         -- timeblock 1 ends, as the number of seconds since midnight
         get startdatetime of timeblock 1 --> returns an AppleScript date representing the day and
         -- time at which timeblock 1 starts
         get duration of timeblock 1 --> returns an integer representing the length of the timeblock,
         -- as the number of seconds between its starttime and its endtime; the value of this property
         -- is stored as 86400 (one day) if you attempt to set it to a larger value (make multiple
         -- timeblocks to create a multi-day or repeating event)
         get completed of timeblock 1 --> returns true if the timeblock is done; false
         -- if not
         get eventdata of timeblock 1 --> a raw data value that can be used to duplicate timeblocks
      end tell
      
      -- NOTE ON TIME VALUES OF A TIMEBLOCK:
      
      -- It is not necessary to set all of the time values of a timeblock explicitly; only those which
      -- are necessary to completely describe the timeblock need be set, and the rest will be calculated
      -- automatically. For example, setting the startdatetime and duration properties allows you to get
      -- the startdate, starttime and endtime properties:
      
      tell timeblock 1 of event 1 of category 1 of document 1
         set startdatetime to date "Dienstag, 1. Januar 2002 23:45:00 Uhr"
         set duration to (2 * hours)
         get startdate --> date "Tuesday, January 1, 2002 12:00:00 AM"
         get starttime --> 42300 (seconds)
         get endtime --> 49500 (7,200 seconds, or 120 minutes, after starttime)
      end tell
      
      -- or setting the startdate, starttime and endtime properties allows you to get the startdatetime
      -- and duration properties:
      
      tell timeblock 1 of event 1 of category 1 of document 1
         set startdate to date "Dienstag, 1. Januar 2002 12:00:00 Uhr"
         set starttime to 42300 -- seconds
         set endtime to 49500 -- 7,200 seconds, or 120 minutes, after starttime
         get startdatetime --> date "Tuesday, January 1, 2002 11:45:00 AM"
         get duration --> 7200 (seconds)
      end tell
      
      -- As a convenience, Now Up-to-Date allows you to use strings to set some of the date and time
      -- values, instead of using AppleScript date values or integers. For example:
      
      tell timeblock 1 of event 1 of category 1 of document 1
         set startdate to "January 1, 2002"
         set starttime to "11:45 AM"
         set endtime to "1:45 PM"
         get startdatetime --> date "Tuesday, January 1, 2002 11:45:00 AM"
         get duration --> 7200 (seconds)
      end tell
      
      -- If the year is omitted from a date string, it will be supplied with reference to the current
      -- year; if the day is omitted, the first will be assumed. Thus, if the current date is April 18,
      -- 2001, you can use "April" for April 1, 2001 or "April 18" for April 18, 2001. For example:
      
      tell timeblock 1 of event 1 of category 1 of document 1
         set startdate to "April 18"
         set starttime to "11:45 AM"
         set endtime to "1:45 PM"
         get startdatetime --> date "Wednesday, April 18, 2001 11:45:00 AM"
         get duration --> 7200 (seconds)
      end tell
      
      -- You can also use relative dates to set the startdate property; that is, the string "yesterday",
      -- "today" or "tomorrow". These generate time values with reference to the current date. For
      -- example, if the current date is April 18, 2001:
      
      tell timeblock 1 of event 1 of category 1 of document 1
         set startdate to "tomorrow"
         set starttime to "11:45 AM"
         set endtime to "1:45 PM"
         get startdatetime --> date "Thursday, April 19, 2001 11:45:00 AM"
         get duration --> 7200 (seconds)
      end tell
      
      -- ELEMENTS:
      
      -- None.
      
      -- MAKING A NEW TIMEBLOCK
      
      -- To make an event that lasts beyond the first day, you must create as many timeblocks in it as
      -- there are calendar days in the event. If the type of the event is banner, it will appear in the
      -- calendar view as a banner; if the type is something else, such as an appointment, it will
      -- appear as individual timeblocks of the same event on the specified days, which need not be
      -- contiguous. Note that, when creating a new event, the first timeblock is created automatically
      -- along with it. You should therefore set its properties rather than trying to create the first
      -- timeblock separately.
      
      set eventRef to make new event at category 1 of document 1 with properties ¬
         {eventtype:"Banner", startdatetime:"December 31, 2001", duration:1 * hours}
      set timeblock2Ref to make new timeblock at eventRef with properties ¬
         {startdatetime:"January 1, 2002", duration:1 * hours}
      set timeblock3Ref to make new timeblock at eventRef with properties ¬
         {startdatetime:"January 2, 2002", duration:1 * hours}
      count every timeblock of eventRef --> 3
      get startdate of timeblock3Ref --> Wednesday, January 2, 2002 12:00:00 AM
      
   end tell
end Read_This_Information

on YOU_CANNOT_RUN_THIS_SCRIPT()
   beep
   activate
   display dialog ("You cannot run this script." & return & return) & ¬
      ("Read it for information about how to write scripts for Now Up-to-Date.") ¬
         buttons {"OK"} default button "OK" with icon note
end YOU_CANNOT_RUN_THIS_SCRIPT


PS: nur noch eine Schlussfrage: dass es mir auch mit eurer Hilfe nicht gelingt aus einem schlichten AppleSkript-Befehlsverzeichnis herauszukriegen wie man ein AppleSkript-adaptiertes Allerweltsprogramm beskripten kann ist das nun einfach Blödheit?
_________________
 Skript-Fan => ein � -Fan =>Scr¿¿-KongFuSius_Kurpfusius
Nach oben
Benutzer-Profile anzeigen Private Nachricht senden AIM-Name
spirigwi
•----->
•----->


Anmeldedatum: 10.07.2003
Beiträge: 1517
Wohnort: Olten-CH

BeitragVerfasst am: 11.09.2005 - 17:52    Titel: geschafft kann mit AppleSkript 1.class-Terminkalender füllen Antworten mit Zitat

Juchuu
--Meine Idee war also nur im Ansatz richtig und dann aber voll daneben :
on VersuchAS()
tell application "Now Up-to-Date"
make new event with properties ¬
{uniqueid:¬
"1", name:¬
"name", description:¬
"descr", owner:¬
"", priority:¬
"none", remindermethod:¬
"bing", remindbefore:¬
"never", eventtype:¬
"appt.", carry forward:¬
"1", startdate:¬
"10.9.2005", starttime:¬
"10:30:00", endtime:¬
"11:30:00", startdatetime:¬
"", duration:¬
"01:00", completed:¬
"doNne"}
end tell
end VersuchAS

--wäre so also zu machen:

my NUPNeuesEvent() --ooooooooooooooooooo
property d : ""
set d to "11.9.05"
set d to date d

on NUPNeuesEvent() --ooooooooooooooooooo
tell application "Now Up-to-Date"
tell category 1 of document 1 --aha! so war das also richtig, wärt ihr drauf gekommen?
set eventSpec to make event at end with properties ¬
{name:"name"} ¬
& {description:"descr"} ¬
& {owner:"mcChef"} ¬
& {priority:"none"} ¬
& {eventtype:"appointment"} ¬
& {remindbefore:0} ¬
& {remindermethod:remindnone} ¬
& {carry forward:false}
make timeblock at event eventSpec with properties ¬
{startdatetime:d} ¬
& {duration:30} ¬
& {completed:false}
end tell
end tell

end NUPNeuesEvent

"600 = 1 h saukomisch, 10x60 wäre doch 10 Min? "
"leider wird den in Preferences eingestellten App.-Zeiten Priorität vor dem AppleAkript-Befehl gegeben.

Das ist wirklich schade, aber natürlich nicht unlösbar, da man das event erneut aanwählen und ändern lassen kann mit AS

Ansonsten hat man nun ein ungeahntes power-tool mit diesen Befehlen in der Hand :

Man kann nämlich jetzt die neu vergebenen Termine aus dem FileMaker heraus vergeben nachdem sie dort nach allen Kriterien simultan in eine Datenbank zurück-geschrieben werden mit AppleSkript!
Merkt ihr eigentlich was hier abgeht? Die Now-up-to-date-Attrappe welche ja ein Terminfindungs-tool ist, wird nun ein in FileMaker intergrierter KALENDER, mit AppleSkript wirds möglich!

Ich habe für diese Technologie zu erreichen ein ganzes Jahr Snow-Forum gebraucht!
und es läuft erst noch OS9X!!

Danke dir Peter SNOW, grossartig.
"

_________________
 Skript-Fan => ein � -Fan =>Scr¿¿-KongFuSius_Kurpfusius
Nach oben
Benutzer-Profile anzeigen Private Nachricht senden AIM-Name
Beiträge der letzten Zeit anzeigen:   
Dieses Forum ist gesperrt, du kannst keine Beiträge editieren, schreiben oder beantworten.   Dieses Thema ist gesperrt, du kannst keine Beiträge editieren oder beantworten.    Fischer-Bayern.de Foren-Übersicht -> AppleScript-Forum Alle Zeiten sind GMT + 2 Stunden
Seite 1 von 1

 
Gehe zu:  
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


AppleScript für absolute Starter