Jump to content

[SOLVED] osascript return url to open


Recommended Posts

I am trying to build a custom URL builder for a bunch of my work URL. I have the following script but it seems that open URL is not detecting the URL. For open URL I put `{query}`. What am I missing? 


 
function run(argv) {
  var appType = argv[0];
  var theEnv = argv[1];
  var url = 'https://www.google.com';

  return url;
}

 

What am I missing? The URL it opens is `https://www.google.com%0a`

Link to comment
7 hours ago, jrock2004 said:

What am I missing?

 

osascript adds a newline to its output (%0a is a URL-encoded newline character), so you're ending up with an invalid URL. You need to add a Transform utility set to "Trim Whitespace" after your Run Script to remove the erroneous newline.

Edited by deanishe
Link to comment
  • vitor changed the title to [SOLVED] osascript return url to open

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...