use AppleScript version "2.8"
use framework "Foundation"
use scripting additions
doLogView()
property objMe : a reference to current application
property objNSString : a reference to objMe's NSString
set strURL to "http://foo bar/" as text
set ocidNSString to objNSString's stringWithString:strURL
log ocidNSString as text
log ocidNSString's className() as text
set ocidNSCFCharacterSet to objMe's NSCharacterSet's URLPathAllowedCharacterSet()
log ocidNSCFCharacterSet's className() as text
set ocidEncodedURL to ocidNSString's stringByAddingPercentEncodingWithAllowedCharacters:ocidNSCFCharacterSet
log ocidEncodedURL as text
log ocidEncodedURL's className() as text
return ocidEncodedURL as text
to doLogView()
tell application "System Events"
set listAppList to title of (every process where background only is false)
end tell
repeat with objAppList in listAppList
set strAppList to objAppList as text
if strAppList is "スクリプトエディタ" then
tell application "Script Editor"
if frontmost is true then
try
tell application "System Events" to click menu item "ログを表示" of menu "表示" of menu bar item "表示" of menu bar 1 of application process "Script Editor"
end try
end if
end tell
end if
end repeat
end doLogView
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions
doLogView()
property objMe : a reference to current application
property objNSString : a reference to objMe's NSString
set strURL to "http://foo bar/" as text
set ocidNSString to objNSString's stringWithString:strURL
log ocidNSString as text
log ocidNSString's className() as text
set ocidNSCFCharacterSet to objMe's NSCharacterSet's URLUserAllowedCharacterSet()
log ocidNSCFCharacterSet's className() as text
set ocidEncodedURL to ocidNSString's stringByAddingPercentEncodingWithAllowedCharacters:ocidNSCFCharacterSet
log ocidEncodedURL as text
log ocidEncodedURL's className() as text
return ocidEncodedURL as text
to doLogView()
tell application "System Events"
set listAppList to title of (every process where background only is false)
end tell
repeat with objAppList in listAppList
set strAppList to objAppList as text
if strAppList is "スクリプトエディタ" then
tell application "Script Editor"
if frontmost is true then
try
tell application "System Events" to click menu item "ログを表示" of menu "表示" of menu bar item "表示" of menu bar 1 of application process "Script Editor"
end try
end if
end tell
end if
end repeat
end doLogView