L
leo-magic
Aktives Mitglied
Thread Starter
- Dabei seit
- 24.12.2004
- Beiträge
- 1.178
- Reaktionspunkte
- 4
Hallo zusammen
Ich bin meinem Projekt schon ein Stückchen näher, stehe aber noch vor einem Problem.
Ich habe folgendes Script, welches über eine URL (Custom Url scheme) aufgerufen wird. Funktioniert auch soweit gut. Arguments werden auch übermittelt.
Nun öffnet der zweite Teil des Scripts ein Shell-Script im Terminal. Macht es bis jetzt auch. Nun aber die Frage:
Wie kann ich die Variable "signature" an das Shell-Script weitergeben und da auf den Wert überprüfen?
Danke und liebe Grüsse
Léo
Ich bin meinem Projekt schon ein Stückchen näher, stehe aber noch vor einem Problem.
Ich habe folgendes Script, welches über eine URL (Custom Url scheme) aufgerufen wird. Funktioniert auch soweit gut. Arguments werden auch übermittelt.
Nun öffnet der zweite Teil des Scripts ein Shell-Script im Terminal. Macht es bis jetzt auch. Nun aber die Frage:
Wie kann ich die Variable "signature" an das Shell-Script weitergeben und da auf den Wert überprüfen?
Danke und liebe Grüsse
Léo
Code:
on open location this_URL
-- When the link is clicked in thewebpage, this handler will be passed
-- the URL that triggered the action, similar to:
--> yourURLProtocol://yourBundleIdentifier?key=value&key=value
-- EXTRACT ARGUMENTS
set x to the offset of "?" in this_URL
set the argument_string to text from (x + 1) to -1 of this_URL
set AppleScript's text item delimiters to "&"
set these_arguments to every text item of the argument_string
set AppleScript's text item delimiters to ""
repeat with i from 1 to the count of these_arguments
set this_pair to item i of these_arguments
set AppleScript's text item delimiters to "="
copy every text item of this_pair to {this_key, this_value}
set AppleScript's text item delimiters to ""
if this_key is "signature" then
set signature to this_value
end if
end repeat
end open location
tell application "Finder" to get folder of (path to me) as Unicode text
set workingDir to POSIX path of result
tell application "Terminal"
do script "sh " & "'" & workingDir & "print_queue.sh" & "'"
end tell
end run