【Photoshop JS脚本】打开URL

1.打开URL

  1. OpenURL()
  2. function OpenURL() {
  3. try{
  4. var URL = new File(Folder.temp + "/baidu.html");
  5. URL.open("w");
  6. URL.writeln('<html><HEAD><meta HTTP-EQUIV="REFRESH" content="0; url=http://www.baidu.com/"></HEAD></HTML>');
  7. URL.close();
  8. URL.execute();
  9. }catch(e){
  10. alert("Error, Can Not Open.");
  11. };
  12. }

2.打开URL_带跳转

  1. openURL("https://jq.qq.com/?_wv=1027&k=58GHjlH")
  2. function openURL(url) {
  3. var fname = "shortcut.url";
  4. var shortcut = new File('/' + fname);
  5. shortcut.open('w');
  6. shortcut.writeln('[InternetShortcut]');
  7. shortcut.writeln('URL=' + url);
  8. shortcut.writeln();
  9. shortcut.close();
  10. shortcut.execute();
  11. shortcut.remove();
  12. };

3.打开URL

system('start http://baidu.com')

4.打开URL

system ("explorer http://baidu.com")
(0)

相关推荐