|
|
#1 |
|
Support with Applescript
Hi. I'm currently working on a Project for a Game. And I'm stumped on what to do next.
I mean, I know what I want to do, but I don't know how to do it. I want to run a Shell Script that downloads a bunch of Shell Scripts into ~/Library/Application Support/minecraftmodinstaller/ So far, I've written the scripts but don't know how to implement them. I would also like to know how I could link the downloaded scripts to buttons in Xcode. I have made the links but don't know the code to make the button open them. My scripts can be found here. They're reasonably long... And the Downloader script can be found here. P.S - This App is Written in Cocoa-Applescript Thanks in Advance - Harry |
|
|
|
0
|
|
|
#2 |
|
In Xcode 3.x.x an on clicked theObject handler would to the trick. Things changed with Xcode 4. Check out http://macscripter.net/viewtopic.php?id=30274
Code:
on clicked theObject if title of theObject = "" then -- run/open your script end if end clicked Last edited by kryten2; May 6, 2012 at 10:15 AM. |
|
|
|
0
|
|
|
#3 | |
|
Quote:
---------- Ok, new problem. When I try and run my Script. I get this error. "Command /usr/bin/osacompile failed with exit code 1" Here is my Code. Code:
on clicked theObject
if title of theObject = "Update Installers!" then
run shell script "rm -rf ~/MCInstaller/scripts/; mkdir ~/MCInstaller/; mkdir ~/MCInstaller/scripts/; cd ~/MCInstaller/scripts/; curl -O http://mossycc.com/Latest/installers.zip; unzip installers.zip -d ~/MCInstaller/scripts/; rm -rf ~/MCInstaller/scripts/__MACOSX/; rm -f ~/MCInstaller/scripts/installers.zip"
end if
end clicked
Eg. I have a Workflow/Script in my Resources folder of the App. But when I drag the file into the Code. It links to it as though I was pulling it in from the Finder. Last edited by Haribo98; May 7, 2012 at 03:01 AM. Reason: Forgot the last bit. |
||
|
|
0
|
|
|
#4 |
|
I've only made some very simple little apps in Xcode 3 myself and barely scratched the surface of Applescript. I think your run shell script causes the error, you can run .scpt files but not run shell script. Try this line in Script Editor and check if things are removed, folders created, curl line works etc. If it works you can adjust your code.
Code:
do shell script "rm -rf ~/MCInstaller/scripts/; mkdir -p ~/MCInstaller/scripts; cd ~/MCInstaller/scripts/; curl -O http://mossycc.com/Latest/installers.zip; unzip installers.zip -d ~/MCInstaller/scripts/; rm -rf ~/MCInstaller/scripts/__MACOSX/; rm -f ~/MCInstaller/scripts/installers.zip" Code:
-- change line below to where you saved your .workflow set workflowpath to "Macintosh HD:Users:martin:Desktop:Example.workflow" set qtdworkflowpath to quoted form of (Posix path of workflowpath) set command to "/usr/bin/automator -v " & qtdworkflowpath set output to do shell script command Last edited by kryten2; May 7, 2012 at 09:24 AM. |
|
|
|
0
|
|
|
#5 |
|
I am not able to access your project to look, but on clicked theObject is an AppleScript Studio handler, which will result in a compile error when building the project if you are using current versions of Xcode with AppleScriptObjC (AppleScript Studio is deprecated as of Snow Leopard).
What OS/Xcode versions are you using? Can you post a smaller example or use a different host that is reliable?
__________________
MacBook Pro / OS X Mountain Lion (10.8.3) / Xcode 4.6 / [various (much) older stuff keeping dust off the shelves] |
|
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
All times are GMT -5. The time now is 07:14 PM.







Linear Mode
