chribo

Hilfe bei Applescript (Pfadangabe zu USB Stick) benötigt

Hallo,
ich habe heute das erste mal ein Applescript bekommenn und ich muß es bearbeiten.

Das Script wird von einem USB-Stick mit beliebigem Namen gestartet.
Das Script ließt nach Eingabe einer ID die Hardware Info aus und soll das Ergebnis als json oder xml als ID.json oder ID.xml auf dem USB Stick speichern.

Das Script lautet folgendermaßen:
set nr to text returned of (display dialog "enter ID" default answer "" with icon note buttons {"Cancel", "Continue"} default button "Continue")  
try
	set command to "system_profiler -json > /Volumes/<Name des USB-Sticks>/" & nr & ".json"  
	do shell script command
on error
	set command to "system_profiler -xml > /Volumes/<Name des USB-Sticks>/" & nr & ".xml"  
	do shell script command
end try

Alles gut soweit, funktioniert, aber der Anwender muß noch <Name des USB-Sticks> anpassen.

Ich will dieses Script aber als Application exportieren, dann kann der Anwender aber nicht mehr den Pfad des USB-Sticks anpassen. Der Anwender soll nur den USB-Stick einstecken, die Application vom Stick durch Doppelklick starten, ID eingeben und fertig.
Wie kann das gelöst werden ?

z.B (?) speichere in dem Pfad von wo aus das Script (die Application) gestartet wurde (?).
oder speicher auf USB-Stick (ohne Namensangabe)

Ein
set command to "system_profiler -json >" & nr & ".json"  
und
set command to "system_profiler -xml>" & nr & ".xml"  
etc.
gibt den Fehler sh. xx.xml: Read-only file system

Ich bin für jeden Tipp dankbar

Gruß
CH
Auf Facebook teilen
Auf X (Twitter) teilen
Auf Reddit teilen
Auf Linkedin teilen

Content-ID: 674053

Url: https://administrator.de/forum/applescript-pfadangabe-usb-stick-benoetigt-674053.html

Ausgedruckt am: 29.07.2025 um 04:07 Uhr