NSRange

[NSRange]文字の検索


【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use framework "AppKit"
use scripting additions

property refMe : a reference to current application

property refNSNotFound : a reference to 9.22337203685477E+18 + 5807

set ocidRange to refMe's NSRange's NSMakeRange(0, 10)
-->{location:0, |length|: 10}
log class of ocidRange
-->(*record*)
set recordRange to ocidRange as record
-->{location:0, |length|: 10}
#
log ocidRange's location
-->(*0*)
# これだとダメ
#log ocidRange's length
#正解はパイプで挟む
log ocidRange's |length|
-->(*10*)

####
set strSampleText to ("美しい日本語の 美しいオープン タイプフォント") as text
set ocidSampleText to refMe's NSMutableString's alloc()'s initWithCapacity:0
ocidSampleText's setString:(strSampleText)
##検索
set ocidGetRange to (ocidSampleText's rangeOfString:("美しい日本語"))
#レンジからテキスト取り出し
log (ocidSampleText's substringWithRange:(ocidGetRange)) as text
##文字からレンジ
log (ocidSampleText's rangeOfString:("美"))






|

[NSMakeRange]最後の1文字

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
##自分環境がos12なので2.8にしているだけです
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
property objNSMutableString : a reference to objMe's NSMutableString


property objNSBackwardsSearch : a reference to objMe's NSBackwardsSearch


property objNSNotFound : a reference to 9.22337203685477E+18 + 5807


set strSampleText to "美しい日本語の オープン タイプフォント"

##まずはNSMutableStrin初期化して
set ocidSampleText to objNSMutableString's alloc()'s initWithCapacity:0

###テキストをNSMutableStringにセット
ocidSampleText's setString:strSampleText
log ocidSampleText as text
log className() of ocidSampleText as text

##文字数数えて
set numChrCnt to (ocidSampleText's |length|) as integer
log numChrCnt as text

###NSMutableString文字列からRangeを作成 これは行末の1文字分のレンジ
set ocidNSRange to objMe's NSMakeRange((numChrCnt - 1), 1)
log ocidNSRange
log class of ocidNSRange


###置き換え
ocidSampleText's replaceOccurrencesOfString:(".") withString:("") options:(1024) range:ocidNSRange
log ocidSampleText as text
log ocidSampleText's className() 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
#########################

|

[NSMakeRange]最初の1文字

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
##自分環境がos12なので2.8にしているだけです
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
property objNSMutableString : a reference to objMe's NSMutableString


property objNSBackwardsSearch : a reference to objMe's NSBackwardsSearch


property objNSNotFound : a reference to 9.22337203685477E+18 + 5807


set strSampleText to "美しい日本語の オープン タイプフォント "

##まずはNSMutableStrin初期化して
set ocidSampleText to objNSMutableString's alloc()'s initWithCapacity:0

###テキストをNSMutableStringにセット
ocidSampleText's setString:strSampleText
log ocidSampleText as text
log className() of ocidSampleText as text



###NSMutableString文字列からRangeを作成 これは行末の1文字分のレンジ
set ocidNSRange to objMe's NSMakeRange(0, 1)
log ocidNSRange
log class of ocidNSRange



###置き換え
ocidSampleText's replaceOccurrencesOfString:(".") withString:("") options:(1024) range:ocidNSRange
log ocidSampleText as text
log ocidSampleText's className() 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
#########################

|

[Safari]cURLのURLからURLのみ取り出す

クリップボードにコピーした値から抽出します
_20220904_18_10_43


#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
##自分環境がos12なので2.8にしているだけです
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
property objNSMutableString : a reference to objMe's NSMutableString
property objNSPasteboard : a reference to objMe's NSPasteboard
property objNSCharacterSet : a reference to objMe's NSCharacterSet
property objNSURL : a reference to objMe's NSURL

property objNSNotFound : a reference to 9.22337203685477E+18 + 5807




####ペーストボードを定義
set ocidPasteboard to objNSPasteboard's generalPasteboard()
log className() of ocidPasteboard as text

###テキストをプレーンテキストで
set ocidReadPasteboard to ocidPasteboard's stringForType:(objMe's NSPasteboardTypeString)
log ocidReadPasteboard as text
log className() of ocidReadPasteboard as text


###クリップボードのテキストをNSMutableString
##まずは初期化して
set ocidCurlCommandText to objNSMutableString's alloc()'s initWithCapacity:0

###テキストのセット上書き
ocidCurlCommandText's setString:ocidReadPasteboard
log className() of ocidCurlCommandText as text
log ocidCurlCommandText as text


###文字列からRangeを作成
set ocidNSRange to ocidReadPasteboard's rangeOfString:ocidCurlCommandText
log ocidNSRange
log class of ocidNSRange

###置き換え
ocidCurlCommandText's replaceOccurrencesOfString:("\n") withString:("") options:(2) range:ocidNSRange
log ocidCurlCommandText as text
log ocidCurlCommandText's className() as text

###文字列からRangeを作成
set ocidNSRange to ocidCurlCommandText's rangeOfString:ocidCurlCommandText
log ocidNSRange
log class of ocidNSRange

###置き換え
ocidCurlCommandText's replaceOccurrencesOfString:("\\") withString:("") options:(2) range:ocidNSRange
log ocidCurlCommandText as text
log ocidCurlCommandText's className() as text

###文字列からRangeを作成最初の'シングルクオトまでのレンジ
set ocidStartRange to ocidCurlCommandText's rangeOfString:("([^\\s]+)") options:(1024)
log ocidStartRange
log class of ocidStartRange

###テキストで戻るので数値とテキストの両方用意
set numStartRange to ocidStartRange's |length|() as integer
set strStartRange to numStartRange + 2 as text
log numStartRange

###文字列からRangeを作成2個目のシングルクオトまで
set ocidEndRange to ocidCurlCommandText's rangeOfString:("^((.+?\\s){1}[^\\s]+)") options:(1024)
log ocidEndRange
log class of ocidEndRange
###テキストで戻るので数値とテキストの両方用意
set numEndRange to ocidEndRange's |length|() as integer
###2個目のシングルクオトから最初のクオトまでのレンジを引いた値が取り出すレンジ
set strEndRange to numEndRange - numStartRange - 3 as text
log numEndRange

#####URL部分のレンジを作成
set ocidNSRangeFromString to objMe's NSRangeFromString(strStartRange & " " & strEndRange)
log ocidNSRangeFromString


###レンジの文字列を取り出す
set ocidUrlText to (ocidCurlCommandText's substringWithRange:ocidNSRangeFromString)
log ocidUrlText as text
log ocidUrlText's className() as text

set strUrlText to ocidUrlText as text

return




#########################ログ表示
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
#########################

|

[NSRange]最後の1文字

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
##自分環境がos12なので2.8にしているだけです
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
property objNSMutableString : a reference to objMe's NSMutableString


property objNSBackwardsSearch : a reference to objMe's NSBackwardsSearch


property objNSNotFound : a reference to 9.22337203685477E+18 + 5807


set strSampleText to "美しい日本語の オープン タイプフォント "

##まずはNSMutableStrin初期化して
set ocidSampleText to objNSMutableString's alloc()'s initWithCapacity:0

###テキストをNSMutableStringにセット
ocidSampleText's setString:strSampleText
log ocidSampleText as text
log className() of ocidSampleText as text

##文字数数えて
set numChrCnt to (ocidSampleText's |length|) as integer
log numChrCnt as text

###NSMutableString文字列からRangeを作成 これは行末の1文字分のレンジ
set ocidNSRange to objMe's NSMakeRange((numChrCnt - 1), 1)
log ocidNSRange
log class of ocidNSRange













#########################ログ表示
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
#########################

|

[NSRange]最初の1文字

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
##自分環境がos12なので2.8にしているだけです
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
property objNSMutableString : a reference to objMe's NSMutableString


property objNSBackwardsSearch : a reference to objMe's NSBackwardsSearch


property objNSNotFound : a reference to 9.22337203685477E+18 + 5807


set strSampleText to "美しい日本語の オープン タイプフォント "

##まずはNSMutableStrin初期化して
set ocidSampleText to objNSMutableString's alloc()'s initWithCapacity:0

###テキストをNSMutableStringにセット
ocidSampleText's setString:strSampleText
log ocidSampleText as text
log className() of ocidSampleText as text



###NSMutableString文字列からRangeを作成 これは行末の1文字分のレンジ
set ocidNSRange to objMe's NSMakeRange(0, 1)
log ocidNSRange
log class of ocidNSRange



###置き換え
ocidSampleText's replaceOccurrencesOfString:(".") withString:("") options:(1024) range:ocidNSRange
log ocidSampleText as text
log ocidSampleText's className() 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
#########################

|

[NSRange] rangeOfString

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
##自分環境がos12なので2.8にしているだけです
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
property objNSMutableString : a reference to objMe's NSMutableString
property objNSRange : a reference to objMe's NSRange



set strText to "美しい日本語"

set ocidNSString to objNSString's alloc()'s initWithString:strText
log ocidNSString as text
log ocidNSString's className() as text
-->(*__NSCFString*)

set ocidMutableString to objNSMutableString's alloc()'s initWithCapacity:0
ocidMutableString's setString:strText
log ocidMutableString as text
log ocidMutableString's className() as text
-->(*__NSCFString*)

###文字列からRangeを作成
set ocidNSRange to ocidMutableString's rangeOfString:"日本語"
log ocidNSRange
log class of ocidNSRange


ocidMutableString's replaceCharactersInRange:ocidNSRange withString:"英語"
log ocidMutableString as text
log ocidMutableString's className() as text
-->(*__NSCFString*)



#########################ログ表示
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
#########################

|

[NSMutableString] deleteCharactersInRange

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
##自分環境がos12なので2.8にしているだけです
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
property objNSMutableString : a reference to objMe's NSMutableString
property objNSRange : a reference to objMe's NSRange



set strText to "美しい日本語"

set ocidNSString to objNSString's alloc()'s initWithString:strText
log ocidNSString as text
log ocidNSString's className() as text
-->(*__NSCFString*)

set ocidMutableString to objNSMutableString's alloc()'s initWithCapacity:0
ocidMutableString's setString:strText
log ocidMutableString as text
log ocidMutableString's className() as text
-->(*__NSCFString*)


ocidMutableString's insertString:"" atIndex:5
log ocidMutableString as text
log ocidMutableString's className() as text
-->(*__NSCFString*)

#####テキストからRangeを作成-->3文字目以降の4文字の意味
set ocidNSRangeFromString to objNSRange's NSRangeFromString("3 4")
log class of ocidNSRangeFromString
log ocidNSRangeFromString as record

ocidMutableString's deleteCharactersInRange:ocidNSRangeFromString
log ocidMutableString as text
log ocidMutableString's className() as text
-->(*__NSCFString*)


#########################ログ表示
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
#########################

|

[NSRange] NSLocationInRange

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
##自分環境がos12なので2.8にしているだけです
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
property objNSMutableString : a reference to objMe's NSMutableString

property objNSNotFound : a reference to 9.22337203685477E+18 + 5807

###初期化 空の可変テキストを作成
set ocidSampleText to objNSMutableString's alloc()'s initWithCapacity:0
###文字列をセット
ocidSampleText's setString:"美しい日本語"

#####テキストからRangeを作成
set ocidNSRangeFromString to objMe's NSRangeFromString("0 1")
log class of ocidNSRangeFromString
log ocidNSRangeFromString as record

###無い=falseになるパターン
set boolRengeCnk to objMe's NSLocationInRange(1, ocidNSRangeFromString)
log class of boolRengeCnk
log boolRengeCnk as boolean
###ある=trueになるパターン
set boolRengeCnk to objMe's NSLocationInRange(0, ocidNSRangeFromString)
log class of boolRengeCnk
log boolRengeCnk as boolean

#########################ログ表示
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
#########################

|

[NSRange] NSNotFound

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
##自分環境がos12なので2.8にしているだけです
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
property objNSMutableString : a reference to objMe's NSMutableString

property objNSNotFound : a reference to 9.22337203685477E+18 + 5807

###初期化 空の可変テキストを作成
set ocidSampleText to objNSMutableString's alloc()'s initWithCapacity:0
###文字列をセット
ocidSampleText's setString:"美しい日本語"
####↑無い文字を検索する
set ocidNSRange to ocidSampleText's rangeOfString:"日本食"
log class of ocidNSRange as text
log ocidNSRange as record
-->(*location:9.22337203685478E+18, length:0*)
(*
location:9.22337203685478E+18
location:NSNotFound なので
*)

if ocidNSRange's location is objNSNotFound then
log "見つかりませんでした"
return
end if




#########################ログ表示
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
#########################

|

より以前の記事一覧

その他のカテゴリー

Accessibility Acrobat Acrobat 2020 Acrobat AddOn Acrobat Annotation Acrobat ARMDC Acrobat AV2 Acrobat BookMark Acrobat Classic Acrobat DC Acrobat Dialog Acrobat Distiller Acrobat Form Acrobat JS Acrobat Manifest Acrobat Menu Acrobat Open Acrobat Plugin Acrobat Preferences Acrobat Preflight Acrobat python Acrobat Reader Acrobat SCA Acrobat SCA Updater Acrobat Sequ Acrobat Sign Acrobat Stamps Acrobat Watermark Acrobat Windows Acrobat Windows Reader Admin Admin Account Admin Apachectl Admin configCode Admin Device Management Admin LaunchServices Admin Locationd Admin loginitem Admin Maintenance Admin Mobileconfig Admin Permission Admin Pkg Admin Power Management Admin Printer Admin SetUp Admin SMB Admin Support Admin System Information Admin Tools Admin Users Admin Volumes Adobe Adobe FDKO Adobe RemoteUpdateManager AppKit Apple AppleScript AppleScript do shell script AppleScript List AppleScript ObjC AppleScript Osax AppleScript PDF AppleScript Pictures AppleScript record AppleScript Script Editor AppleScript Script Menu AppleScript Shortcuts AppleScript Shortcuts Events AppleScript System Events AppleScript System Events Plist AppleScript Video Applications AppStore Archive Attributes Automator BackUp Barcode Barcode QR Barcode QR Decode Bash Basic Basic Path Bluetooth BOX Browser Calendar CD/DVD Choose Chrome CIImage CityCode CloudStorage Color com.apple.LaunchServices.OpenWith Console Contacts CotEditor CURL current application Date&Time delimiters Desktop Device Diff Disk Dock DropBox Droplet eMail Encode % Encode Decode Encode UTF8 Error EXIFData ffmpeg File Finder Firefox Folder FolderAction Fonts GIF github Guide HTML HTML Entity Icon Illustrator Image Events Image2PDF ImageOptim iPhone iWork Javascript Jedit Json Label Leading Zero List locationd LRC lsappinfo LSSharedFileList m3u8 Mail MakePDF Map Math Media Media AVAsset Media AVconvert Media AVFoundation Media AVURLAsset Media Movie Media Music Memo Messages Microsoft Microsoft Edge Microsoft Excel Mouse Music NetWork Notes NSArray NSArray Sort NSBezierPath NSBitmapImageRep NSBundle NSCFBoolean NSCharacterSet NSColor NSColorList NSData NSDecimalNumber NSDictionary NSError NSEvent NSFileAttributes NSFileManager NSFileManager enumeratorAtURL NSFont NSFontManager NSGraphicsContext NSImage NSIndex NSKeyedArchiver NSKeyedUnarchiver NSLocale NSMutableArray NSMutableDictionary NSMutableString NSNotFound NSNumber NSOpenPanel NSPasteboard NSpoint NSPredicate NSPrintOperation NSRange NSRect NSRegularExpression NSRunningApplication NSScreen NSSize NSString NSString stringByApplyingTransform NSStringCompareOptions NSTask NSTimeZone NSURL NSURL File NSURLBookmark NSURLComponents NSURLResourceKey NSURLSession NSUserDefaults NSUUID NSView NSWorkspace Numbers OAuth OneDrive PDF PDFAnnotation PDFAnnotationWidget PDFContext PDFDisplayBox PDFDocumentPermissions PDFImageRep PDFKit PDFnUP PDFOutline perl Photoshop PlistBuddy pluginkit postalcode PostScript prefPane Preview Python QuickLook QuickTime ReadMe Regular Expression Reminders ReName Repeat RTF Safari SaveFile ScreenCapture ScreenSaver SF Symbols character id SF Symbols Entity sips Skype Slack Sound Spotlight sqlite SRT StandardAdditions Swift System Settings TCC TemporaryItems Terminal Text Text CSV Text MD Text TSV TextEdit Tools Translate Trash Twitter Typography UI Unit Conversion UTType valueForKeyPath Video VisionKit Visual Studio Code VMware Fusion Wacom webarchive webp Wifi Windows XML XML EPUB XML OPML XML Plist XML RSS XML savedSearch XML SVG XML TTML XML webloc XML XMP YouTube zoom