Jump to content

robotspacer

Member
  • Posts

    4
  • Joined

  • Last visited

Everything posted by robotspacer

  1. Awesome, thanks for all the suggestions. I like the idea of outputting to a text file. qlmanage didn't work too well for me, but that gave me a great idea. I put together this AppleScript: on run argv if argv is not null then set errorTitle to item 1 of argv if the number of items in argv is 1 then display notification with title errorTitle else set errorMessage to item 2 of argv display notification errorMessage with title errorTitle end if end if return end run So I can call that at various points in my script: osascript notification.scpt "Archiving $SCHEME" "See output at $OUTPUT_FILE" That way I know everything is working and I can see when it's done. If it fails I can check the output file for details. I've also put together an AppleScript I can call with osascript to show an error message and then "do shell script theScript with administrator privileges" as needed. That makes for a much nicer workflow than opening Terminal. Thanks again for the help!
  2. As mentioned, Run Script doesn't seem to work well in this case. Basically what I'm doing is running a script that uses xcodebuild and a few other commands to archive and export an app using Xcode. There are a few different issues: xcodebuild generates a LOT of output. I can't find anyway to use Run Script and display the output in a useful way. "Large Text" gives a screen full of tiny text, and a notification gives the first couple of lines. (If it were the last couple, that might work, but still not great.) It takes a while, so I'd rather see the output as it runs than at the end—otherwise I'm just waiting a while and assuming it's actually working. There's one case where I need to prompt for a password—though I actually wouldn't mind changing this if I could find a solution for the output problem.
  3. The problem is the working directory isn't what I want. The Terminal Command action doesn't set the working directory—it basically just opens a Terminal window and enters the command you gave it. That means the working directory is just /Users/name rather than the workflow's folder. That said, I can use your suggestion to piece together the entire command in my Script Filter, and pass the whole thing as the argument. It's messy though, and I'm worried some characters may not get escaped correctly. It'd be a lot nicer if I could just reference the workflow folder path from my Terminal Command action.
  4. I'm trying to keep my workflow self contained, if possible, by including a shell script inside the workflow's folder. If I use the "Run Script" action this works fine, because the working path is already set to the workflow's folder. But "Run Script" doesn't work well. If something fails there's no good way to see the output—a notification shows the first line or two instead of the last—and in some cases my script needs to prompt for a password. If I use the "Terminal Command" action it solves those problems—it runs in a Terminal window so I can see all the output and enter my password if necessary. The only problem is I can't figure out how to call my script—unless I hard code the path to the workflow's folder of course. Currently my script is: ~/Library/Application\ Support/Alfred\ 2/Alfred.alfredpreferences/workflows/user.workflow.406901EC-104D-1B51-5C20-1E588DB2D207/archive.sh {query} I've tried: ./archive.sh {query} But that fails because the script isn't in my home folder. So I guess I need something like: {workflow-folder}/archive.sh {query} Is there some way to do this, or is it just not possible?
×
×
  • Create New...