搜尋此網誌

24 11月 2020

Actionscript 複製 Photoshop 檔案名稱到剪貼簿

 var folderForTempFiles = Folder.temp.fsName;
 var text=activeDocument.name;

   // create a new textfile and put the text into it

   var clipTxtFile =new File(folderForTempFiles + "/ClipBoard.txt");
   clipTxtFile.open('w');
   clipTxtFile.write(text);
   clipTxtFile.close();

   // use the clip.exe to copy the contents of the textfile to the windows clipboard
   var clipBatFile =new File(folderForTempFiles + "/ClipBoard.bat");
   clipBatFile.open('w');
   clipBatFile.writeln("type \"" + folderForTempFiles + "\\" + "ClipBoard.txt\" | clip");
   clipBatFile.close();
   clipBatFile.execute();

沒有留言: