2016-07-29 42 views
0

Ich bin neu und Xcode wie ich bin AppleMac OS App basierend auf Apple

Alles was ich brauche ist ein Applescript in einer Xcode Anwendung auszuführen. Ist das möglich ?

bassically, wird die Anwendung von Bildern von einer URL-Liste in Excel Herunterladen und benennt die Dateien die Liste in Excel

Vielen Dank im Voraus Acording! Grüße aus Deutschland! Hier

ist der Applescript-Code:

tell application "Microsoft Excel" 
    set filenames to value of every cell of range "K3:K200" of sheet "Image_Moves" of document 1 
    set URLs to value of every cell of range "L3:L200" of sheet "Image_Moves" of document 1 
end tell 

repeat with i from 1 to count URLs 
    if (item i of filenames is not missing value) and (item i of URLs is not missing value) then 
    set thisFname to quoted form of (POSIX path of ({path to desktop, "Image_Moves:"} as text) & item i of filenames) 
    set thisUrl to quoted form of item i of URLs 
    set status to (do shell script "curl -s -o " & thisFname & space & thisUrl) 
    end if 
end repeat 

try 
    tell application "Finder" 
    delete (every item of folder ("Image_Moves") whose name begins with "0") 
    end tell 
on error 
    display dialog ("Error. Couldn't Move the File") buttons {"OK"} 
end try 
+0

Unklar was Ihr Problem ist. Wie steht es überhaupt mit Xcode? Was ist eine Xcode-Anwendung? – Eiko

+0

Eiko, ich habe eine Version von Applescript und möchte sie in eine Mac OS, App umwandeln. Wie steht es mit Xcode? Nun, von dem, was ich weiß, kannst du das mit X-Code machen, oder? – AnotherUser31

Antwort

1

In Xcode können Sie eine vollständige Anwendung in Applescript mit der "Cocoa-Apple" Vorlage schreiben. Außerdem können Sie ein AppleScript mit der NSAppleScript-Klasse kompilieren und ausführen. Wenn Ihre Frage nur darin besteht, eine AppleScript-Datei ausführbar zu machen, verwenden Sie Speichern unter ... im Skript-Editor und speichern Sie Ihr AppleScript als Anwendung.

HTH

+0

Danke SteffX, ich wäre sehr froh, wenn Sie mir helfen könnten, mein Applescript mit der NSAppleScript-Klasse zu kompilieren. Bitte bitte bitte – AnotherUser31