AppleScript के माध्यम से Google खोज


2

मैं AppleScript के साथ एक Google खोज करना चाहता हूं। कोड इस तरह दिखता है:

set search to text returned of (display dialog "Google Search" buttons {"OK"} default answer {""})
open location ("https://www.google.de/#q=" & search)

समस्या यह है कि मैं रिक्त स्थान को कैसे बदल सकता हूं +?

जवाबों:


3

यहाँ वर्ण बदलने के लिए एक सबरूटीन है:

on replace_chars(this_text, search_string, replacement_string)
  set AppleScript's text item delimiters to the search_string
  set the item_list to every text item of this_text
  set AppleScript's text item delimiters to the replacement_string
  set this_text to the item_list as string
  set AppleScript's text item delimiters to ""
  return this_text
end replace_chars

स्रोत: http://www.macosxautomation.com/applescript/sbrt/sbrt-06.html

AppleScript की उन दो पंक्तियों के बीच, निम्नलिखित डालें:

set search to replace_chars(search," ","+")
हमारी साइट का प्रयोग करके, आप स्वीकार करते हैं कि आपने हमारी Cookie Policy और निजता नीति को पढ़ और समझा लिया है।
Licensed under cc by-sa 3.0 with attribution required.