Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Automator: adding spaces in variables

I can't figure out how to put a space between a variable and other text or even another variable, as Automator automatically removes both standard and nonbreaking (Option+sp) spaces.

User uploaded file

MacBook Pro, Mac OS X (10.6.7), 13 inch, 2011

Posted on Jun 15, 2011 7:57 AM

Reply
8 replies

Jun 15, 2011 8:15 AM in response to Ryccardo

so that looks like the input to a workflow, where you want to tun a shellscript of the form:


/prog <program name> <song name>


if that's the case, then you need to either quote (use single or double quotes) or escape (use backslash) the spaces in the cli


quoted: /prog 'program name' 'song name'

escaped: /prog program\ name song\ name

Jun 15, 2011 9:01 AM in response to Ryccardo

Ah, I see… don't do it that way. :-)


you're already using Run AppleScript, so just change your first Run AppleScript action so that it reads:


tell application "iTunes"

set {itsAlbum, itsArtist, itsName, itsYear} to {album, artist, name, year} of current track

if itsYear is 0 then set itsYear to "?"

return "/me [iTunes] " & itsArtist & " - " & itsName & " (" & itsAlbum & "(" & itsYear & "))"

end tell


then go straight to the Copy to Clipboard action.

Automator: adding spaces in variables

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.