Applescript Anfänger braucht Hilfe ;))

N

Nilay

Neues Mitglied
Thread Starter
Dabei seit
26.03.2007
Beiträge
8
Reaktionspunkte
0
Hallo Leute,

Ich habe heute zum aller ersten mal veruscht mit AppleScript einen Eintrag in Now Up-To-Date anzulegen.
Doch es klappt nicht da immer dieser Fehler auftritt : "„Now Up-To-Date“ hat einen Fehler erhalten: Einige Daten können nicht in den erwarteten Typ umgewandelt werden."




Ich vermute der Fehler liegt an dieser Stelle : (tell application "Now Up-To-Date"
make new event at pfad with properties {name:"test123"}), doch ich weis nicht recht warum?
Ich habe schon viele ausprobiert aber es will nicht klappen...

weis jmd rat?

Vielen Dank im voraus ;)


p.s: Ganzes Script :

display dialog "It´s going to be imported into now Up-To-Date"

set test to {eventtype:"appointment", startdate:"March 26", starttime:"15:30 PM", endtime:"16:40 PM", completed:false}
set pfad to "Macintosh HD:Users:nilay:Documents:TEST.nud"


tell application "Now Up-To-Date"
make new event at pfad with properties {name:"test123"}
end tell
 
Hallo,

ohne es überprüft zu haben:

Code:
	set pfad to "Macintosh HD:Users:nilayocuments:TEST.nud" as file specification

Viele Grüße
 
Hey ;)

Hallo,

zuerst mal danke für deine Antwort .. aber ich werde daraus nicht schlau ;)

Willst du damit sagen das mein Pfad falsch ist oder wie?
Denn mein Pfad ist eigentlich richtig ;)
 
Denn mein Pfad ist eigentlich richtig ;)
Pfadangaben gehören leider zu den verwirrendsten Dingen für AS-Neulinge (und nicht nur...); führe einfach mal im ScriptEditor diese beiden Beispiele aus:

PHP:
set pfad to "Macintosh HD:Users:nilay:documents:TEST.nud"
class of pfad
-- > string: "pfad" ist ein ganz banaler Textstring wie z.B. "hallo"

und

PHP:
set pfad to "Macintosh HD:Users:nilay:documents:TEST.nud" as alias
class of pfad
-- > wenn der File existiert: alias ! "alias" bedeutet eine Referenz zu einem bestehenden Finderelement (ansonsten gibt's ne Fehlermeldung...)

Good scripting
Farid
 
Heyho .. ;)

Danke viemals für den Tipp, habe jetzt das mit dem Pfad verstanden ;)

Ich habe jetzt das ganze so geändert

PHP:
set pfad to "Macintosh HD:Users:nilay:Dokumente:TEST.nud" as alias

aber jetzt sagt er immer die Datei ist nicht auffindbar obwohl diese existiert?


Vielen Dank im voraus


Grüße Nilay
 
Also hab da jetzt gerade wieder rumgespielt und die Fehlermeldung das die Datei nicht gefunden wird ist wieder weg.

Aber nun habe ich wieder dieses Problem :

PHP:
Now Up-To-Date“ hat einen Fehler erhalten: Einige Daten können nicht in den erwarteten Typ umgewandelt werden."

Worauf weist diese Fehlermeldung hin? Ich verstehe diese nicht ganz recht..


greetz

Nilay
 
Worauf weist diese Fehlermeldung hin? Ich verstehe diese nicht ganz recht..
Ich kenne "Now Up-To-Date" und sein Scriptverzeichnis leider ueberhaupt nicht, der folgende Tip daher ohne Gewaehr:

PHP:
tell application "Now Up-To-Date"
open pfad
make new event with properties {name:"test123"}
end tell

Frohes Scripten
Farid
 
Servas,

Danke für deine Hilfe...

Es schaut grad so aus :

gebe ich das hier ein :

PHP:
display dialog "It´s going to be imported into now Up-To-Date"

set test to {eventtype:"appointment", startdate:"March 26", starttime:"15:30 PM", endtime:"16:40 PM", completed:false}
set pfad to "Macintosh HD:Users:nilay:Documents:TEST.nud" as alias

tell application "Now Up-To-Date"
	open pfad
	make new event at pfad with properties {name:"test123"}
end tell

macht er immer wieder diese Meldung :

PHP:
„Now Up-To-Date“ hat einen Fehler erhalten: Einige Daten können nicht in den erwarteten Typ umgewandelt werden."

Ändere ich die Zeile :

PHP:
	make new event at pfad with properties {name:"test123"}

in diese hier :
PHP:
make new event with properties {name:"test123"}

gibt er mir diese Meldung :

PHP:
"„Now Up-To-Date“ hat einen Fehler erhalten: Einige Parameter fehlen für „make“."

Ich schätze mal diese eine Zeile is einfach vollkommen Falsch ... weil ich werde aus der 1. Fehlermeldung nicht schlau .. falls du mir erklären könntest worauf sich die bezieht ? wär ich dir dankbar ;)


grüße

Nilay
 
Ciao Nilay,
wie bereits gesagt kenne ich das Programm nicht und habe deshalb auch keine Ahnung, welche AppleScript-Kommandos sein Verzeichnis enthaelt.
Vielleicht kannst Du ja einfach mal das Scriptverzeichnis von "Now Up-To-Date" hier veroeffentlichen, damit alle Mitstreiter sehen koennen, welche AppleScript-Befehle das Programm anbietet.

Farid
 
  • Gefällt mir
Reaktionen: Nilay
Seas,

Also hier hab ich das ganze ma kopiert ;))

PHP:
category?n : A custom or built-in category for classifying events
elements
contains events; contained by documents.
properties
owner (text, r/o) : the name of the person who created the category
name (text) : the name of the category
description (text) : the purpose for which the category is used
eventnames (list, r/o) : event type names corresponding to eventtypes
eventtypes (list, r/o) : event type types corresponding to eventnames
prioritynames (list, r/o) : priority names corresponding to prioritytypes (omits "None" for 'Pr00')
prioritytypes (list, r/o) : priority types corresponding to prioritynames
event?n : An event, such as a holiday, appointment or to-do
elements
contains persons, timeblocks; contained by documents, categorys.
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
person?n : A person or company associated with an event
elements
contained by events.
properties
firstname (text) : the first name of the person
lastname (text) : the last name of the person
phone (text) : the primary phone number of the person
phonetitle (constant) : the label of the person's primary phone number. Set it using the text "home", "work", "mobile" or "fax".
companyname (text) : the person's company name
contactlink (integer) : a link from this person in Now Up-to-Date to the same person in Now Contact. Set it by concatenating "L#" and the person's Now Contact unique id.
workphone (text) : the person's work phone number
homephone (text) : the person's home phone number
faxphone (text) : the person's fax phone number
mobilephone (text) : the person's mobile phone number
otherphone (text) : another phone number of the person
email1 (text) : the person's primary email address
email2 (text) : the person's secondary email address
URL (text) : the person's Web address or other Uniform Resource Locator
timeblock?n : A date and time associated with an Event. Multiple timeblocks in an event denote a repeating event. Properties of timeblock 1 can also be accessed as properties of its parent event.
elements
contained by events.
properties
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 the event is done, false if not
eventdata (event data) : all the data of the timeblock and its event (use 'make new event with data eventdata' at a calendar to duplicate an event)

greetz

Nilay
 
Hmm... neugierig geworden hatte ich kurz mit dem Gedanken gespielt eine Demo von "Now Up-To-Date" zu testen, aber die Installation erschien mir dann doch zu umständlich :p
Vielleicht geht das: ? (mußt dafür ein Programmdokument geöffnet haben)
PHP:
tell document 1 of application "Now Up-To-Date"
set mynewevent to make new event with properties {name:"test123"}
end tell

Frohes schaffen
Farid
 
Najo ... ;) so finds bei mir auch an mit dem neugierig sein ... :p

Also nun sagt er dies hier :

PHP:
"„Now Up-To-Date“ hat einen Fehler erhalten: Einige Parameter fehlen für „make“."


grüße

Nilay
 
...

Hallo Nilay,

ich könnte mir vorstellen, man muss zumindest den eventtype bei der Erstellung mit angeben. Wenn auch nur wenige Parameter gesetzt werden.

eventtype (holiday/special/appointment/to-do/call/undated/stickynote/banner/graphic) : the kind of event

bis jetzt gibst Du ja nur den Namen an. Die Events haben bestimmt unterschiedliche Formate.

...
set mynewevent to make new event with properties {eventtype:holiday; name:"test123"}
...

Gruß Andi
 
Also,

Hab das auch getestet .. aber daran liegt es leider auch ned ;)

Aber danke für den Tipp


Grüße

Nilay
 
Zurück
Oben Unten